Reputation: 59
I was created jar file in eclipse. but I had a some problem.
First, I made a jar file in eclipse.
And I was created shell script and start this application but NoClassDefFoundError
was occurred.
But when I was created Runable JAR file instead of JAR file that this error isn't occurred. what's the problem?
please help me.
Upvotes: 0
Views: 62
Reputation: 1260
As par exception class you require is not available while application is running so more chances that you are using external library in your application.
So, you need to specify the library path while running your application by using CLASSPATH
, so your command to execute application should like:
java -classpath "<pathOfYourLibarary>" <package.name>.<MainClassname>
Note: If you have multiple jars(libraries) then separate it with ;
sign and if you all the libraries are in same folder the use path to folder and *
like
java -classpath "D:/lib/*" <package.name>.<MainClassname>
Upvotes: 1