This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "NoClassDefFoundError" Watch "NoClassDefFoundError" New topic
Author

NoClassDefFoundError

srikanth arroju
Ranch Hand

Joined: Aug 02, 2006
Posts: 66
when i run a bat file of the installer at the command prompt



Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3455
    
  12
java -jar doesn't use the environment classpath setting. You need to specify the classpath in the jar's manifest file.
[ April 25, 2008: Message edited by: Joanne Neal ]

Joanne
srikanth arroju
Ranch Hand

Joined: Aug 02, 2006
Posts: 66
actually iam installing the application using install4j tool.when i run the jar command the application should run.i cannot hardcode the classpath setting
because it may run on my system but on other system the classpath will be different.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3455
    
  12
So install the required jar files in the same directory as InstaSecure.jar and use relative paths names in your classpath.
srikanth arroju
Ranch Hand

Joined: Aug 02, 2006
Posts: 66
But problem is the required jar files are different for different software version which the user may be selecting.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3455
    
  12
Well your install program will have to sort that out. All I'm saying is, if you want to use the -jar option of java then you have to specify your classpath in the manifest file. If this is a problem then don't use the -jar option.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: NoClassDefFoundError