简体   繁体   中英

NoClassDefFoundError Exception occured

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM