FBN: jar file to submit - Need help

raphael Bereh

Ranch Hand

Posts: 79

posted 14 years ago

Hi all, As the different packages in the FBN assignment uses "import suncertify.mypackage", how are we suppose to organize the jar files to submit ? I mean, if my package suncertify.server, import the suncertify.db, and the package suncertify.client also import the db package, how do I create client.jar and server.jar ? Do I have to include suncertify.db in both jar files ? Thanks for your help.

Well Sai Prasad I am trying to that but I get the following error about the "imported" packages : ClassNoDefFounError : ... when I try to run the jar file using java -jar myjar_file.jar (where an entry point has been defined) Can you help ? Thanks

SCJP,SCJD,SCBCD

Sai Prasad

Ranch Hand

Posts: 560

posted 14 years ago

I guess the jar file doesn't contain one of the referenced classes.

raphael Bereh

Ranch Hand

Posts: 79

posted 14 years ago

No It does not, And my question is : Do I have to add all the imported packages in each of these jar or is a way around it ? Regards,

SCJP,SCJD,SCBCD

Sai Prasad

Ranch Hand

Posts: 560

posted 14 years ago

Imported packages must be present in the CLASSPATH. There is no way around it.

Matthew Comer

Ranch Hand

Posts: 37

posted 14 years ago

Three ways to fix your problem: 1) Add the extra jars to the classpath on the command line 2) Put the extra jars on your classpath using the environment variable 3) *RECOMMENDED* Put an entry in the manifest file of the main jars that references the extra jars Matt

raphael Bereh

Ranch Hand

Posts: 79

posted 14 years ago

Thanks Matthew Comer and Sai Prasad , I have tried the following on command line : Set CLASSPATH=My_extra_jar_file.jar java -jar my_server.jar or java -classpath My_extra_jar_file.jar -jar my_server.jar but none of these worked. Still get ClassNoDefFoundError. How do you add the referrence to the extra jar in the manifest ? Thanks.