This is my java project structure
lib/*.jar
manifest.txt
Mytest.java
I follow theses steps to create a jar
1. javac -cp .:lib/* Mytest.java
2. jar -cvfm mytest.jar manifest.txt Mytest.class lib
Now run the jar file
java -jar mytest.jar
It works fine.
However, if I delete the lib folder, then run the jar file, it won't work
rm -rf lib
java -jar mytest.jar
Error: Unable to initialize main class Mytest
Caused by: java.lang.NoClassDefFoundError: org/orekit/frames/Frame
It appears java still tries to find the dependencies in the local path instead of the archived jar file.