This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executing jar files and inner class errors

 
Bryan Clauser
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting a error
Exception in thread "main" java.lang.NoClassDefFoundError: suncertify/client/FBNGui$SymItem

when I execute my client.jar file, I can see that it starts fine, but blows up when it hits the first inner class.

The inner classes are included in the jar file:

jar cvfm client.jar MANIFEST.MF \
suncertify/client/FBNGui.class \
suncertify/client/FBNGui$SymItem.class \
suncertify/client/FBNGui$1.class \
suncertify/client/FBNGui$SymAction.class \
suncertify/client/FBNGui$SymWindow.class \
....

the manifest file looks like:

Main-Class: suncertify/client/FBNGui

Any ideas why it can find the main class, but not the inner class?
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you have only this jar file in the CLASSPATH and not any directories.
Also try to give "public" access to SymItem inner class.
 
Bryan Clauser
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sai,
The Path only has the jar file in it, and I tried changing the inner class to public and it still said that it could not be found.
Any other ideas?
 
Adam Caldwell
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure you got all of the inner classes? You should probably do FBNGui*.class to make sure you get all of them. Also, to make sure you're not flirting with a classpath problem, you can explicity specify the jar file:
java -jar client.jar cmd_line_args
Also, you manifest looks wrong... you have / instead of .
Mine looked like:
Main-Class: suncertify.gui.FlyByNightGui
-Adam
 
Bryan Clauser
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adam,
I found out what the problem is, I am developing on a linux box using Blackdown java 1.3.1 and there must be a bug or something wrong with the jar command, because I put my same code & package structure on both a Win98 and NT machines and created and executed the jars fine.
[ April 08, 2002: Message edited by: Bryan Clauser ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic