2011-03-03 98 views
0

在Eclipse中所有運行良好,但在出口的jar:C:\ WAMP \ WWW \ JOGL> Java的罐子Test.jar的什麼問題JOGL(日食)

Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/opengl/GLEventListener 
     at java.lang.ClassLoader.defineClass1(Native Method) 
     at java.lang.ClassLoader.defineClassCond(Unknown Source) 
     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$000(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) 
Caused by: java.lang.ClassNotFoundException: javax.media.opengl.GLEventListener 
     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) 
     ... 12 more 
Could not find the main class: windows.SimpleScene. Program will exit. 

項目文件夾:

C:\WAMP\WWW\JOGL 
├───.settings 
├───bin 
│ └───windows![enter image description here][1] 
├───jogl-2.0-b11 
│ ├───etc 
│ ├───jar 
│ ├───jnlp-files 
│ └───lib 
└───src 
    └───windows 

IDE截圖:

http://i.piccy.info/i5/40/33/1183340/Properties_for_JOGL.png

JAR(7zip的)

http://i.piccy.info/i5/38/33/1183338/CwampwwwJOGLtest.jar.png

回答

3
java -Djava.library.path="lib" -cp test.jar:jar/jogl.all.jar:jar/newt.all.jar:jar/nativewindow.all.jar mypackage.MyJOGLApp 

應該工作。異常告訴你,jogl不在類路徑中(-cp參數)。之後,你會得到一個lib加載異常,因爲沒有本地libs將在lib路徑(-Djava.library.path屬性)

[編輯]在Windows使用';'作爲路徑分隔符而不是':'