Problems by JOGL in NetBeans 6

hi

iam a skilled opengl coder, but a virgin in coding gl under java (and a virgin in java overall)…

i installed Netbeans and opengl plugins from http://www.java-gaming.org/forums/index.php?topic=12530.msg111617#msg111617

but when i open a demo like JOGLParticlesDemo and let it run, i get the fallowing error message

init:
deps-jar:
Created dir: F:\Work\Java\NetBeans\JOGLParticlesDemo\build\classes
Compiling 6 source files to F:\Work\Java\NetBeans\JOGLParticlesDemo\build\classes
Note: F:\Work\Java\NetBeans\JOGLParticlesDemo\src\demos\particles\engine\Engine.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Copying 1 file to F:\Work\Java\NetBeans\JOGLParticlesDemo\build\classes
compile:
run:
Exception in thread “main” java.lang.NoClassDefFoundError: com/sun/gluegen/runtime/DynamicLookupHelper
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:106)
at javax.media.opengl.GLCanvas.(GLCanvas.java:113)
at javax.media.opengl.GLCanvas.(GLCanvas.java:82)
at demos.particles.engine.GLComponent.(GLComponent.java:54)
at demos.particles.engine.JOGLParticlesDemo.initComponents(JOGLParticlesDemo.java:94)
at demos.particles.engine.JOGLParticlesDemo.(JOGLParticlesDemo.java:68)
at demos.particles.engine.JOGLParticlesDemo.main(JOGLParticlesDemo.java:197)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

whats the problem? thank you

A java.lang.NoClassDefFoundError usually indicates that a class can’t bound or one of its dependencies is is missing. From the Javadoc:

[quote]"Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.

The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found. "
[/quote]
The best way to work out what is going wrong is to look at the stack trace. The oldest call is at the bottom and the most recent on the top.

This first thing to check is whether your CLASSPATH contains the JAR which contains the class and then to see whether they of the right version.

Edit: Looking at the following thread would suggest a conflict in JOGL versions. Maybe you compiled with one version and are attempting to run with another, incompatible version:

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1193238872

i should use the reference problem dialog, but there is no such dialog in netbeans 6 (it should appear in the menu after right clicking, but it isnt there)

also in libs is written missing library : JOGL, so i added, but the result stays the same…

" Add “gluegen-rt.jar” to your build path and make sure “gluegen-rt.dll” is in your “java.library.path” "

i should copy to “gluegen-rt.jar” F:\Work\Java\NetBeans\JOGLFlyingTextDemo2\build\ , from where?

and to c:\Program Files\Java[b]jdk1.6.0_02[/b]\lib\ or c:\Program Files\Java[b]jre1.6.0_02[/b]\lib\ , and from where?

thank you

http://www.politea.sk/tmp/Zwischenablage01.jpg

Don’t copy the gluegen.jar to anywhere. Same applies for the jogl.jar. Please make sure, you haven’t done already (scan the jdk/jre lib and ext directories) and delete the extra installations.

The plugin should handle all the neccessary dependencies, the broken reference message is a bug in the project setup due to being a prerelease version ;). It should work regardless. After cleaning up your system from extra jogl installs, delete and recreate the demo you wanted to test and try again.

If it still does not work, we will try to trace the bug down and give you guidance how to set up the jogl dependencies for netbeans on your own for the time being.

Hi elvenone,

I fixed this bug already on Friday in svn, but forgot uploading the new modules (again)…
I haven’t incremented the module versions, so could you please remove all OpenGL modules (except update center) and re-install them again?

There where some API and behavior changes of the netbeans beta builds, please tell us if you find more bugs.
But cylab is right, even if netbeans has problems parsing the classpath the demos should run because they are run by ant (i 've tested it already).

Important Note:
please don’t use the “JOGL FormDesigner Integration” module - it is broken
use this workaround instead:
https://netbeans-opengl-pack.dev.java.net/servlets/ReadMsg?list=users&msgNo=4
we will try to address that bug in future builds