# Struggling to get set up with JOGL2.0

I did have JOGL1.1 set up and working, but I soon discovered that it did not support the latest OpenGL, so I started work on upgrading to JOGL2.0 it's not gone too well.

Firstly, is it worth me trying to get JOGL to work, or should I just move over to LWJGL? I am fairly comfortable with OpenGL (via C++) and from what I did get working with JOGL1.1, I seem to be OK adapting to it.

Assuming that I stick with JOGL, am I foolish for trying to use JOGL2.0? From what I can gather, JOGL2.0 is still in beta, but I am willing to go with it as I want to make use of the latest OpenGL I can.

I have been using the Eclipse IDE and have set up a user library for JOGL, here is a screen shot of the configuration and I have added this user library to my own Eclipse project. the system variable %JOGL_HOME% points to "C:\Users\edacosh\Downloads\JOGL2.0" so that should work fine.

Now, the problem I actually having, when I try to run my code, on the line

GLProfile glp = GLProfile.getDefault();


The code stops with the following message...

Exception in thread "main" java.lang.NoClassDefFoundError: com/jogamp/common/jvm/JVMUtil
at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:1145)
at DiCE.DiCE.<init>(DiCE.java:33)
at App.<init>(App.java:17)
at App.main(App.java:12)
Caused by: java.lang.ClassNotFoundException: com.jogamp.common.jvm.JVMUtil
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)
... 4 more


I have also set my project to ensure that it is using jre6 along with jdk6, as I was having some issues.

• That error simply means that the JVM couldn't find the com.jogamp.common.jvm.JVMUtil class. You are most likely missing a JAR in your build path configuration. As for LWJGL vs JOGL, that's up to you; perhaps this and this will help you. Notice that JOGL 2.0 has been out for over a year, perhaps several years. Personally, I still can hardly stand the JOGL site and can't find important stuff like downloads. Nov 15 '11 at 13:28
• @Ricket, why y u no post as answer? But yeah, thanks for the info bud. Any idea how to work out what jar I would be missing? Nov 15 '11 at 13:39
• A JAR file is just a zip file, so I'd recommend just looking in your JAR files for that class file. Or maybe there's some documentation of which JAR files are needed? Or a JOGL chatroom/forum? I've pretty much given up on JOGL, not that it's a bad library at all, but LWJGL is actively being developed and used (Minecraft uses it, for example). Nov 15 '11 at 13:54
• @thecoshman Don't use JOGL, use LWJGL instead. Google for more details. Dec 15 '11 at 15:14
• @iamcreasy yeah... because that helps ¬_¬ Dec 15 '11 at 15:54

That error simply means that the JVM couldn't find the com.jogamp.common.jvm.JVMUtil class. You are most likely missing a JAR in your build path configuration.

As for LWJGL vs JOGL, that's up to you (and is entirely opinion, so not a good fit for this site); perhaps this and this will help you. Notice that JOGL 2.0 has been out for over a year, perhaps several years.

In order to fix the "Exception in thread "main" java.lang.NoClassDefFoundError: com/jogamp/common/jvm/JVMUtil"

You need to add the gluegen-rt.jar and jogl-all.jar to the classpath for both java and javac, the two jars are provided by JogAmp JOGL.

You may want to read the JogAmp Wiki that include setup instructions on how to do this:

http://jogamp.org/wiki/index.php/Setting_up_a_JogAmp_project_in_your_favorite_IDE

http://jogamp.org/wiki/index.php/Setting_up_a_JogAmp_project_in_your_favorite_IDE#Compile_and_run_your_project_from_the_command_line

I had really good luck using this: http://www3.ntu.edu.sg/home/ehchua/programming/opengl/JOGL2.0.html