• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executable server.jar problem

 
fan wang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does your server manifest file look like?
Eugene.
 
fan wang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your Server.java class have public static void main(String[] args) method?
 
fan wang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic