java.lang.NoClassDefFoundError: com/jogamp/common/type/WriteCloneable jogl 2 in eclipse

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7576691/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:03:38  来源:igfitidea点击:

java.lang.NoClassDefFoundError: com/jogamp/common/type/WriteCloneable jogl 2 in eclipse

eclipseexceptionjogl

提问by user968049

I am on windows 7 64 bit and using eclipse indigo. I downloaded the latest version of jogl 2 and i have created an eclipse project following this link

我在 Windows 7 64 位上使用 eclipse indigo。我下载了最新版本的 jogl 2,并按照此链接创建了一个 eclipse 项目

https://sites.google.com/site/justinscsstuff/jogl-tutorial-2

https://sites.google.com/site/justinscsstuff/jogl-tutorial-2

this tutorial is old as the jars in the jogl download dont match and i have included all the jars and for each jar set the native libraries directory. I have written a small jogl test program that creates a GLProfile, GlCapabilities and an awt frame. I get this exception:

本教程很旧,因为 jogl 下载中的 jar 不匹配,我已经包含了所有 jar,并为每个 jar 设置了本机库目录。我编写了一个小的 jogl 测试程序,它创建了一个 GLProfile、GlCapabilities 和一个 awt 框架。我得到这个例外:

java.lang.NoClassDefFoundError: com/jogamp/common/type/WriteCloneable
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access
<dependency>
    <groupId>org.jogamp.jogl</groupId>
    <artifactId>jogl-all</artifactId>
    <version>2.0-rc11</version>
</dependency>
0(URLClassLoader.java:58) at java.net.URLClassLoader.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access
<dependency>
    <groupId>org.jogamp.gluegen</groupId>
    <artifactId>gluegen-rt-main</artifactId>
    <version>2.0-rc11</version>
</dependency>
0(URLClassLoader.java:58) at java.net.URLClassLoader.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) Caused by: java.lang.ClassNotFoundException: com.jogamp.common.type.WriteCloneable at java.net.URLClassLoader.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 24 more Exception in thread "main"

seems like im missing a jar..could any let me know what im doing wrong here?

好像我错过了一个罐子……有没有人可以让我知道我在这里做错了什么?

回答by andrea

I am using the jogl-all.jar from Matlab 2014a. The error above disappeared and everything run smoothly when I added the library glugen-rt.jar.

我正在使用 Matlab 2014a 中的 jogl-all.jar。当我添加库glugen-rt.jar时,上面的错误消失了,一切运行顺利。

(remember also to -Djava.library.path=/path/to/native/files when you execute your application, in my case this was -Djava.library.path=/Applications/MATLAB_R2014a.app/bin/maci64)

(还记得在执行应用程序时 -Djava.library.path=/path/to/native/files,在我的例子中是 -Djava.library.path=/Applications/MATLAB_R2014a.app/bin/maci64)

回答by vanBlu

Try to add gluegen as well.

也尝试添加胶水。

For example

例如

##代码##

AND

##代码##

回答by vandiedakaf

I had a similar problem with the JOGL jar files. See here. Also, check out the tutorials on the jogamp wiki(by the looks of it Wade is pretty active on the wiki).

我对 JOGL jar 文件有类似的问题。见这里。另外,请查看jogamp wiki上的教程(从表面上看,Wade 在 wiki 上非常活跃)。

回答by user968049

i checked the link you gave and it seems like they had changed the structure after that tutorial was made. In any case, i download the march 2011 binaries and it works fine..

我检查了您提供的链接,似乎他们在制作该教程后更改了结构。无论如何,我下载了 2011 年 3 月的二进制文件,它运行良好。