> I have included the "jdom.jar" file in the classpath as you had told me, Justin.<br><br>I'm pretty sure you haven't. Those errors indicate that the jdom jar isn't in your classpath (or, more accurately, that the classes that should be contained within
jdom.jar aren't in your classpath).<br><br>I'm not sure what kind of environment you're in, but my experience is that this type of basic Java issue is best solved in person, not via email. There's simply too many variables which are hard to guess at but self-evident for someone looking over your shoulder. So I'd suggest finding a seasoned Java developer amongst your co-workers or friends and have them help you compile.
<br><br><div><span class="gmail_quote">On 11/28/06, <b class="gmail_sendername">Anshul Saxena</b> <<a href="mailto:anshulacxiom@gmail.com">anshulacxiom@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am trying to compile the following program :<br><br>import org.jdom.*;<br>import org.jdom.output.XMLOutputter;<br>public class example2a<br>{<br> public static void main(String[] args)<br> {<br> Element root = new Element("myRootElement");
<br> Document doc = new Document(root);<br> root.setText("This is a root element");<br> System.out.println(doc);<br> }<br>}<br><br>The errors I am getting are :<br><br>example2a.java:1: package
org.jdom does not exist<br>import org.jdom.*;<br>^<br>example2a.java:2: package org.jdom.output does not exist<br>import org.jdom.output.XMLOutputter;<br> ^<br>example2a.java:7: cannot find symbol<br>
symbol : class Element<br>location: class example2a<br> Element root = new Element("myRootElement");<br> ^<br>example2a.java:7: cannot find symbol<br>symbol : class Element<br>location: class example2a
<br> Element root = new Element("myRootElement");<br> ^<br>example2a.java:8: cannot find symbol<br>symbol : class Document<br>location: class example2a<br> Document doc = new Document(root);
<br> ^<br>example2a.java:8: cannot find symbol<br>symbol : class Document<br>location: class example2a<br> Document doc = new Document(root);<br> ^<br>6 errors
<br><br>I have included the "jdom.jar" file in the classpath as you had told me, Justin.<div><span class="e" id="q_10f304db787cb680_1"><br><br><br><div><span class="gmail_quote">On 11/28/06, <b class="gmail_sendername">
Justin Edelson</b> <<a href="mailto:justinedelson@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
justinedelson@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><span>>I tried to use the build command and it created a "classes" and "src" folder.
<br></span>This compiled JDOM. Unless you've made changes to the JDOM source code, there's really no reason to do this. There should be a jdom.jar file in the build directory already. This jar is what should be added to your classpath.
<span><br><br>> Kindly tell me what I have to do next ? <br></span>It's a little hard to tell you what you have to do next since you haven't told us what it is you're trying to do.<div><span>
<br><br><br><div><span class="gmail_quote">On 11/28/06,
<b class="gmail_sendername">Anshul Saxena</b> <<a href="mailto:anshulacxiom@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">anshulacxiom@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Justin,<br>Thanks for your prompt response!<br>I am new to both jdom and java so please forgive my asking trivial questions.<br>I downloaded and extracted the Jdom-1.0 as you had suggested.<br>I see the following folders there :
<br>build<br>etc<br>lib<br>package<br>samples<br>src<br>build.bat<br>build.sh<br>build.xml<br>CHANGES.txt<br>COMMITTERS.txt<br>LICENSE.txt<br>README.txt<br>TODO.txt<br><br>I tried to use the build command and it created a "classes" and "src" folder.
<br>Kindly tell me what I have to do next ? <br>Waiting for a reply!<br><br>Regards<div><span><br><div><span class="gmail_quote">On 11/28/06, <b class="gmail_sendername">Justin Edelson
</b> <<a href="mailto:justinedelson@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
justinedelson@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You're not including jdom.jar in your classpath. Is there a reason you need to use the beta version? JDOM
1.0 is over two years old now.<br><br>And... I don't know why you're referencing jaxp.jar in the first place. Both b10 and
1.0 contain a jar called xml-apis.jar. If you're using Java 1.5 (or 1.4 for that matter), you dont't need xml-apis.jar or xerces.jar. If you're not using JDOM's XPath classes, all you need is %JDOM_HOME%\build\jdom.jar, assuming JDOM_HOME is set to where you unzipped the
jdom-1.0.zip file.<br><br><div><div><span><span class="gmail_quote">On 11/28/06, <b class="gmail_sendername">Anshul Saxena</b> <<a href="mailto:anshulacxiom@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
anshulacxiom@gmail.com</a>> wrote:</span></span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><span>
I am getting the above error although my class path settings are :<br>CLASSPATH:<br>.;C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip;C:\java\jdom-b10\build;%JDOM_HOME%\build\classes;<br>%JAVA_HOME%\lib\tools.jar;%JDOM_HOME%\lib\xerces.jar;%JDOM_HOME%\lib\jaxp.jar
<br><br>JAVA_HOME : C:\Program Files\Java\jdk1.5.0_09<br>JDOM_HOME: C:\java\jdom-b10<br><br>I cannot see any "jaxp.jar" file in the jdom folder. Is this the cause for the error. If it is, then how can i get this file. I don't think it comes with the current version of jdom-b10.
<br><br>Kindly reply ASAP.<br><br>Regards<br>
<br></span></div>_______________________________________________<br>To control your jdom-interest membership:<br><a href="http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com</a><br><br></blockquote></div><br>
</blockquote></div><br>
</span></div></blockquote></div><br>
</span></div></blockquote></div><br>
</span></div></blockquote></div><br>