aspose file tools*
The moose likes Applets and the fly likes how to add jar files to applet's classpath    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "how to add jar files to applet Watch "how to add jar files to applet New topic
Author

how to add jar files to applet's classpath

John Mclain
Ranch Hand

Joined: Nov 04, 2007
Posts: 30
hi everyone,
i got an issue to add jar file's to applt's classpath,
i looked around accross many resources but getting no solution on this.

i have a commons-httpclient3.1.jar and i have to make it available it to a an applet class bundled in a jar file say myjar.jar

how can i achieve it?

any help would be much appreciated

thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41899
    
  63
You would use the archive attribute of the applet tag.


Ping & DNS - my free Android networking tools app
John Mclain
Ranch Hand

Joined: Nov 04, 2007
Posts: 30
actually, i didn't describe my problem clearly

i have to difine a classpath to point commons-httpclient.jar in manifest.mf file

please suggest me how to do this
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41899
    
  63
I don't think the manifest is used with applets, so that wouldn't do any good. Why do you "have to" do that? Using the archive tag is the proper way to do this.
[ December 06, 2007: Message edited by: Ulf Dittmer ]
John Mclain
Ranch Hand

Joined: Nov 04, 2007
Posts: 30
i do need to add a classpath entry of a jar file in manifest.mf file of a jar only.

i know what should i include for this as

Class-Path:myjar.jar

but i have a little problem to understand that, where should i write this line if i have a jar file say classes.jar and if classes.jar is in a perticular directory. moreover, how can i make this entry inside a jar file?
i am using jdk1.6.0_02
i my points sit right, please erase my dumb quary

thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41899
    
  63
I still don't understand why you need to do this. Earlier we were talking about an applet, and applets don't use manifest files.

You can find information about jar files and manifests here, particularly the section titled "Adding Classes to the JAR File's Classpath".
 
Consider Paul's rocket mass heater.
 
subject: how to add jar files to applet's classpath