aspose file tools
The moose likes Java in General and the fly likes Executing a Jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Executing a Jar file" Watch "Executing a Jar file" New topic
Author

Executing a Jar file

Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
Hi

I have a problem in running a java class which is present inside a jar.

I just compiled the classes to bin folder and created a jar using “jar cvf test.jar -C bin .”. Everything is success until this step. After that I tried executing “java -cp test.jar EnvTest”

NOTE: Class EnvTest has a main method. I don't want executable jar.

Am getting below error. Please assist me.

Exception in thread "main" java.lang.NoClassDefFoundError: EnvTest

Please assist me
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 377
You have to give the fully qualified name if the class is in package.


SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Executing a Jar file
 
Similar Threads
desktop applications
Using a jar in classpath on command line
jar files - classNotFoundException
"jar cvf classes.jar classes.class" is not correct?
Jar manifest problem