This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes executable server.jar problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "executable server.jar problem " Watch "executable server.jar problem " New topic
Author

executable server.jar problem

fan wang
Greenhorn

Joined: Feb 26, 2003
Posts: 4
I packed my project into two executable jar files: client.jar & server.jar, when i input "java -jar client.jar", it works well. But if i input " java -jar server.jar", the system will give the following error message "Exception in thread "main" java.lang.NoClassDefFoundError: suncertify/dbserver/Server", but I tried to input "java suncertify/dbserver/Server", it works. Anyone met the same problems before? Help
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
How does your server manifest file look like?
Eugene.
fan wang
Greenhorn

Joined: Feb 26, 2003
Posts: 4
My server manifest file is MANIFEST.MF:
Manifest-Version: 1.0
Created-By: 1.2.2 (Sun Microsystems Inc.)
Main-Class: suncertify.dbserver.Server

it is similar to client manifest file, but I am puzzled the client.jar run well, but server.jar gives the error message.
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

Main-Class: suncertify.dbserver.Server

Double check to make sure that server.jar contains suncertify/dbserver/Server.class. Is it there under that directory in the jar? Does the package declaration match it?
Eugene.
fan wang
Greenhorn

Joined: Feb 26, 2003
Posts: 4
yes, I have double checked again.The file server.jar contains suncertify/dbserver/Server.class. it is under that directory in the jar, and the package declaration matches it?
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
Does your Server.java class have public static void main(String[] args) method?
fan wang
Greenhorn

Joined: Feb 26, 2003
Posts: 4
Yes.
I solved my problem a moment ago by just rewrite another manifest.mf file with the same content. I guess maybe the wrong reason is because orignal manifest.mf file contain illegal characters which can not be displayed by my Editor.
It is a strange error with strange and foolish reason. I don't know how the original manifest.mf file get the illegal charcter when i write it.
Anyway, thanks for your help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: executable server.jar problem