I have an application that uses an external jar. I used eclipse and it works fine. I export as jar from eclipse, having created a Manifest file that has as Class-Path: ./cab.v1.jar I place both jars in the same directory. I run in command line: java -jar myApp.jar
and get java.lang.NoClassDefFoundError for the classes in the cab.v1.jar (the other jar) Have also tried java -cp . -jar myApp.jar but no success. What am I doing wrong?
If you use the
-jar
option the classpath is ignored. You could start the application byThe class path separator ':' is ';' on windows.
Using the documentation for the Manifest it does not use a
./
for relative directories. Try it just with:Note that the
-cp
option is ignored when using-jar
.