I'm using JDOM to create XML file in an Applet class, but it seems that the Applet can't find the JDOM classes. I searched the web and found that something has to do with the JDOM jar file, but couldn't find clear explanation. Can anyone help me to resolve this issue?
Post your applet tag. It needs to have an archive attribute that points to the jar file, and the jar file needs to be publicly accessible - I'd put it in the same directory as the HTML/JSP file that contains the applet tag.
the tag initially was like this: <applet code="CApplet.class" width="500" height="200"></applet>
Then change it to: <applet code="CApplet.class" Archive="jdom.jar" width="500" height="200"> </applet>
This jdom jar is the one i downloaded from the Internet and then imported it in the project libraries..
but the error is the same!
While searching the net, I found that i may have to import one jar file that will integrate the applet and the jdom, is that right? or I should create another jar file so whenever the jdom is imported in the applet, it will be imported from the java jdk jar files, not the jdom real one..
I don't think I got the idea clear, and there aren't many posts on the net about this issue.
Can anyone help me with this , and I'll appreciate that.
There's nothing you need to do with the jar file, nor do you need any other jar file.
The attribute is named archive, not Archive; you should fix that.
Where does the jar file live relative to your HTML file? You talk about "project libraries" - that makes me think you're using an IDE. That often doesn't work so well for running applets. Try running the HTML directly in the browser, and keep the jar file in that directory as well.
thanks. I changed the Attribute to "archive", but the error is the same. The jdom jar file resides in the home directory where the applet and the index file are both under webapps under apache under the root directory. I tried copying the jdom file into the same directory of the applet using the "sudo" command, but whenever there is changes in the eclipse, it disapears from there and can't make the link.
do you have any idea of what is going on there and how to solve this?