Reputation: 95
I am building a small software which requires the JDateChooser component. In the images below, I added the classpath for jcalendar.jar to "Environment Variables" and I also created a new library and added jcalendar.jar to it as shown in the image.
Everything is fine, I can run the software and nothing wrong with it, but when I try to run the jar file of the software on different PC, and I got the error below. It seems to me that I have provided the wrong classpath for it. Please correct me if I am wrong, and any ideas how to fix this?
Thanks.
C:\Users\user>java -jar C:\Users\user\Desktop\SmallProject.jar
Exception in thread "main" java.lang.NoClassDefFoundError: com/toedter/calendar/JDateChooser
at smallproject.SmallProject.main(SmallProject.java:19)
Caused by: java.lang.ClassNotFoundException: com.toedter.calendar.JDateChooser
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 1 more
C:\Users\user>
This is my classpath.
and this is my jar that I added to netbeans.
Upvotes: 0
Views: 34