My MANIFEST.MF file looks like this
My main() prints the classpath -
ClassLoader cl = ClassLoader.getSystemClassLoader();
URL[] urls = ((URLClassLoader)cl).getURLs();
for(URL url: urls){
System.out.println(url.getFile());
}
I am running jar file as-
java -jar "C:\Project-1.0-SNAPSHOT.jar"
When I run the jar file, I don't see any of the class paths set in manifest file. I only see the absolute path to C:\Project-1.0-SNAPSHOT.jar
. Why is that so? Obviously code fails to run due to java.lang.NoClassDefFoundError
error
Note that I am using maven-jar-plugin
to create this jar file