• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Applet can't find JDOM classes, how to solve this?

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

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?

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

I'll move the topic to the Applet forum.
 
Mouza Ali
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, thanks.

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.

Thanks in advance for the Applet forum.

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Mouza Ali
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello again,

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?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what Eclipse is doing, but if it's causing problems then I'd start by running the applet in the browser without Eclipse running at all.
 
Mouza Ali
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello..

the problem has been solved successfully

thanks
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic