can't get classpath right after following the wiki

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

can't get classpath right after following the wiki

sirus20x6
in intellij's project structure section I have the classpath as


.;
jar\gluegen-rt.jar;
jar\jogl-all.jar;
./gcdata.jar;


and when I run my jar I get



PS C:\java> java -classpath "jar\gluegen-rt.jar;jar\jogl-all.jar;." -jar wilsim.jar
Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/opengl/GLEventListener
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        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 Wilsim.init(Wilsim.java:36)
        at Wilsim.main(Wilsim.java:66)
Caused by: java.lang.ClassNotFoundException: javax.media.opengl.GLEventListener
        at java.net.URLClassLoader$1.run(Unknown Source)
        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)
        ... 14 more
PS C:\java>
Reply | Threaded
Open this post in threaded view
|

Re: can't get classpath right after following the wiki

Wade Walker
Administrator
When you use the -jar command line switch, java ignores the classpath setting -- you can't use -jar and -classpath together, as shown by the documentation of the -jar option at http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html. Try putting your jar in the classpath, then using your main class name as the last argument to java, as shown on the wiki at https://jogamp.org/wiki/index.php/Setting_up_an_JogAmp_project_in_your_favourite_IDE#Compile_and_run_your_project_from_the_command_line.
Reply | Threaded
Open this post in threaded view
|

Re: can't get classpath right after following the wiki

gouessej
Administrator
In reply to this post by sirus20x6
Wade is right and you can set the classpath manifest attribute too.
Julien Gouesse | Personal blog | Website