我正在试图弄清楚如何用Java编写OpenGL,但是当我运行教程here时,正确加载了所有库(我认为),因为它能够导入库,它给了我这个奇怪的错误:
"C:\Program Files\Java\jdk1.7.0_25\bin\java" -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 12.1.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.7.0_25\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\jce.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\jfxrt.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\resources.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\rt.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext\zipfs.jar;C:\Code\Java\Games\Rust\out\production\Rust;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jocl.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-test.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-test.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-android.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-noawt.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-mobile.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-android.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-test-android.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-test-android.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt-android.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-natives-linux-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jocl-natives-linux-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-natives-linux-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-natives-linux-armv6.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jocl-natives-linux-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jocl-natives-linux-armv6.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-natives-solaris-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-natives-windows-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jocl-natives-solaris-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jocl-natives-windows-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-natives-android-armv6.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-natives-linux-armv6hf.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-natives-solaris-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-natives-windows-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jocl-natives-android-armv6.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jocl-natives-linux-armv6hf.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jocl-natives-solaris-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jocl-natives-windows-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-natives-linux-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-natives-linux-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-natives-linux-armv6.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt-natives-linux-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\joal-natives-macosx-universal.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jocl-natives-macosx-universal.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-natives-solaris-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-natives-windows-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt-natives-linux-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt-natives-linux-armv6.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-natives-android-armv6.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-natives-linux-armv6hf.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-natives-solaris-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-natives-windows-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt-natives-solaris-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt-natives-windows-i586.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt-natives-android-armv6.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt-natives-linux-armv6hf.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt-natives-solaris-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt-natives-windows-amd64.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\jogl-all-natives-macosx-universal.jar;C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-rt-natives-macosx-universal.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 12.1.4\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain SimpleScene
Catched FileNotFoundException: C:\Code\Java\Libraries\jogamp-all-platforms\jar\gluegen-natives-windows-amd64.jar (The system cannot find the file specified), while addNativeJarLibsImpl(classFromJavaJar class com.jogamp.common.os.Platform, classJarURI jar:file:/C:/Code/Java/Libraries/jogamp-all-platforms/jar/gluegen.jar!/com/jogamp/common/os/Platform.class, nativeJarBaseName gluegen-natives-windows-amd64.jar): [ file:/C:/Code/Java/Libraries/jogamp-all-platforms/jar/gluegen.jar -> file:/C:/Code/Java/Libraries/jogamp-all-platforms/jar/ ] + gluegen-natives-windows-amd64.jar -> slim: jar:file:/C:/Code/Java/Libraries/jogamp-all-platforms/jar/gluegen-natives-windows-amd64.jar!/
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: C:\Code\Java\Games\Rust\gluegen-rt.dll
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1846)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1061)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:551)
at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:64)
at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:96)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:414)
at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:388)
at com.jogamp.common.os.Platform$1.run(Platform.java:203)
at java.security.AccessController.doPrivileged(Native Method)
at com.jogamp.common.os.Platform.<clinit>(Platform.java:173)
at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:82)
at SimpleScene.main(SimpleScene.java:8)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Process finished with exit code 1
任何人都知道它有什么问题吗?
答案 0 :(得分:0)
我没有删除不需要的文件。您可以看到要使用的文件列表here。
答案 1 :(得分:0)
我遇到了同样的问题。
除了添加Jars文件外,还需要在配置界面时设置dll目录。 在User Libraries窗口(此处为Eclipse),展开每个Jars,编辑本机库位置。当询问目录时,请转到包含.dlls文件的文件夹。 (可能是/ lib)
我遵循了本教程:http://sites.google.com/site/justinscsstuff/jogl-tutorial-1 和这个论坛:http://forum.jogamp.org/Jar-reference-td3346099.html
祝你好运!
答案 2 :(得分:0)
将jogl安装目录中的文件gluegen-rt-natives-windows-amd64.jar重命名为gluegen-natives-windows-amd64.jar。奇怪的是,由于某种原因,运行时尝试加载文件gluegen-natives-windows-amd64.jar而不是gluegen-rt-natives-windows-amd64.jar