I used Fat-Jar eclipse plugin to create my jar. It work fine on windows when I double click it, but when I try to run it from command line with : "java -jar Trasplantes.jar" the result is "Unable to access jarfile Trasplantes.jar". After searching a little bit I found some find the solution was to execute this :
"java -cp -jar .;C:\Trasplante\Trasplantes.jar " but that give me the error :
"Exception in thread "main" java.lang.NoClassDefFoundError: /;C:\Trasplante\Trasplantes/jar
Caused by: java.lang.ClassNotFoundException: .;C:\Trasplante\Trasplantes.jar
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: .;C:\Trasplante\Trasplantes.jar. Program will exit."
I really need to run it on command line so I can test it with emma.
Please I really need this working, and thank for any response that bring some light in these
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used Fat-Jar eclipse plugin to create my jar. It work fine on windows when I double click it, but when I try to run it from command line with : "java -jar Trasplantes.jar" the result is "Unable to access jarfile Trasplantes.jar". After searching a little bit I found some find the solution was to execute this :
"java -cp -jar .;C:\Trasplante\Trasplantes.jar " but that give me the error :
"Exception in thread "main" java.lang.NoClassDefFoundError: /;C:\Trasplante\Trasplantes/jar
Caused by: java.lang.ClassNotFoundException: .;C:\Trasplante\Trasplantes.jar
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: .;C:\Trasplante\Trasplantes.jar. Program will exit."
I really need to run it on command line so I can test it with emma.
Please I really need this working, and thank for any response that bring some light in these