aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes FBN: jar file to submit - Need help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "FBN: jar file to submit - Need help" Watch "FBN: jar file to submit - Need help" New topic
Author

FBN: jar file to submit - Need help

raphael Bereh
Ranch Hand

Joined: Jan 15, 2002
Posts: 79
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.


SCJP,SCJD,SCBCD
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
raphael A B,
Please change your display name to comply with The JavaRanch Naming Policy.
Thank You


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I had,
fbnServer.jar - Server only files
fbnClient.jar - Client only files
fbnCommon.jar - Used by client and server
fbnServerForClient.jar - _Stub classes and remote interfaces.
raphael Bereh
Ranch Hand

Joined: Jan 15, 2002
Posts: 79
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
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I guess the jar file doesn't contain one of the referenced classes.
raphael Bereh
Ranch Hand

Joined: Jan 15, 2002
Posts: 79
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,
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Imported packages must be present in the CLASSPATH. There is no way around it.
Matthew Comer
Ranch Hand

Joined: Aug 10, 2001
Posts: 37
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

Joined: Jan 15, 2002
Posts: 79
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: FBN: jar file to submit - Need help
 
Similar Threads
New to SCJD
Trouble running packaged jar application
trying to get suncertify.db classes to compile
Pass scjd
Should lock methods be callable by the client