[jdom-interest] hello all

Jason Hunter jhunter at collab.net
Wed Jul 12 11:22:38 PDT 2000


> I have just attempted to use beta 4 of jdom.. and cannot get this
> simple code to work....
> 
> import org.w3c.dom.Document;
> import org.w3c.dom.Element;
> 
> public class JDOMBean {
> 
>     public static void main (String[] argv) {
> 
>         Document doc = new Document(new Element("root"));
>         System.out.println("Success!!");
>       }
>     }
> 
> i get the following errors.....when i try to compile...
> Cannot user operator new for this type....
> Cannot parse intializer..... and
> no method found Element(string) or no method found Element() if i dont
> put the string in.... i know that element is an abstract class... so
> ?   :) hello again

You're importing org.w3c.dom classes.  That means you're using DOM.  You
need to import org.jdom classes if you want to use JDOM.

-jh-



More information about the jdom-interest mailing list