Error Package Org.jdom Does Not Exist
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error with Jdom 2.0.5 and java during my compilation up vote 0 down vote favorite I try to compil with jdom, my directory look like that : jdom-2.0.5.jar, ParseurXml.java, XMLEnt.xml i've already try to export my classpath, but It still not woking at all. My ParseurXML.java contain only tree import, and write that in my stderr : ParseurXml.java:2: error: package org.jdom does not exist import org.jdom.; ^ ParseurXml.java:3: error: package org.jdom.input does not exist import org.jdom.input.; ^ ParseurXml.java:4: error: package org.jdom.output does not exist import org.jdom.output.*; ^ ParseurXml.java:12: error: package org.jdom does not exist static org.jdom.Document document; I compile like that: javac -classpath jdom-2.0.5.jar ParseurXml.java java linux classpath linuxmint jdom-2 share|improve this question asked Feb 8 '14 at 16:08 user3287563 31 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote accepted So long as you're in the same directory as these files when calling javac, its' nearly always a good idea to include the current directory in the classpath On linux you can use this javac -classpath .:./jdom-2.0.5.jar ParseurXml.java So the above specifies the current directory at the start of the classpath (i.e. the leading . character) Then the following : character is a separator Then the following ./jdom-2.0.5.jar says to look for your jdom jar file in the current directory. share|improve this answer answered Feb 8 '14 at 17:18 Brad 7,46533352 add a comment| up vot
This Site Careers Other all forums Forum: XML and Related Technologies package org.jdom does not exist Maha Hassan Ranch Hand Posts: 133 posted 10 years ago Dear All, I have troubles installing jdom. I followed the stepshere but still i get errors.. I am trying to run the following example import org.jdom.*; public class example1 { public static void main(String[] args) { Element root = new Element("myRootElement"); Document doc = new Document(root); root.setText("This is a root element"); System.out.println(doc); } } and i get the following errors --------------------Configuration:
?! NetBeans Forums -> NetBeans Users View previous topic :: View next topic http://forums.netbeans.org/topic45508.html Author Message daggettJoined: 04 Nov 2011Posts: 5 Posted: Sun Dec http://forums.devx.com/showthread.php?149659-JDOM-Classpath-Help-Required 18, 2011 9:07 am Post subject: org.jdom.Element does not exist in /usr/share/java/jdom1.jar ?! (It won't help that I am trying to revive a java application I last developed and ran 10 years ago, however ...) In the window for a java error package source file, there is a red exclamation mark immediately prior to: Code: import org.jdom.Element; The error message is: Quote: package org.jdom does not exist However, in /usr/share/java/jdom1.jar org.jdom.Element does exist: Quote: jar tf jdom1.jar META-INF/ META-INF/MANIFEST.MF org/ ... org/jdom/Document.class org/jdom/Element.class ... As a test, after I tested for he existence of error package org.jdom the class org.jdesktop.layout.Baseline : Quote: nuuk java # jar tf swing-layout.jar META-INF/ META-INF/MANIFEST.MF org/ ... org/jdesktop/layout/Baseline.class ... ... I added to the source code: Code: import org.java.desktop.layout.Baseline; ... I still got (almost) the same error message: Quote: package import org.jdesktop.layout.Baseline does not exist. Unused import So it is not even able to find java packages that were already on my file system. (Whether they were downloaded with NetBeans or came with my Ubuntu Linux distribution I can't say.) How do I fix this? (BTW, I couldn't find any other discussions relating to this problem since 2009.) Back to top daggettJoined: 04 Nov 2011Posts: 5 Posted: Sun Dec 18, 2011 2:00 pm Post subject: Where to put additional .jar files? I have put debugging statement into the shell script /usr/bin/NetBeans in order to try to learn where .jar files are supposed to be kept. What I came up with is: Quote: /usr/share/netbeans/6.9/nb: /usr/share/netbeans/6.9/ide: /usr/share/netbeans/6.
JDOM Classpath Help Required If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 6 of 6 Thread: JDOM Classpath Help Required Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 01-13-2006,08:31 AM #1 kpandya View Profile View Forum Posts Registered User Join Date Jan 2006 Location London Posts 11 JDOM Errors Help Required Hi Guys, I am trying to follow an example using JDOM, which will write, update delete an XML file. I thought I had set the JDOM & Xerces classpaths correctly, but I'm guessing not now: I had one error in my java file as follows: C:\Tomcat 5.5\webapps\ROOT\XMLEdit>javac CATALOGManager.java CATALOGManager.java:81: illegal escape character FileWriter f = new FileWriter(new File("C:\\Tomcat 5.5\\webapps\\ROOT\\X MLEdit\CATALOG1.xml")); ^ 1 error So I forgot the extra '\' in the path. Not a problem. When I then went onto compile the java file thinking all was ok, I got the following errors: C:\Tomcat 5.5\webapps\ROOT\XMLEdit>javac CATALOGManager.java CATALOGManager.java:3: package org.jdom does not exist import org.jdom.*; ^ CATALOGManager.java:4: package org.jdom.output does not exist import org.jdom.output.XMLOutputter; ^ CATALOGManager.java:6: package org.jdom.input does not exist import org.jdom.input.*; ^ CATALOGManager.java:7: package org.jdom.output does not exist import org.jdom.output.*; ^ CATALOGManager.java:12: cannot find symbol symbol : class Document location: class XMLEdit.CATALOGManager Document docs; ^ CATALOGManager.java:18: cannot find symbol symbol : class SAXBuilder location: class XMLEdit.CATALOGManager SAXBuilder builder = new SAXBuilder(); ^ CATALOGManager.java:18: cannot find symbol symbol : class SAXBuilder location: class XMLEdit.CATALOGManager SAXBuilder builder = new SAXBuilder(); ^ CATALOGManager.java:19: cannot find symbol symbol : variable doc location: class XMLEdit.CATALOGManager doc = builder.build(filename); ^ CATALOGManager.java: