I have a very simple application which I'm trying to port from JOGL 1.1.1a to JOGL 2. It compiles correctly (in Eclipse 3.6.1 - Ganymede) but when it runs I get the following:
Exception in thread "main" java.lang.NoSuchMethodError: javax.media.opengl.GLContext.getAvailableGLVersionsSet(Ljavax/media/nativewindow/AbstractGraphicsDevice;)Z
at javax.media.opengl.GLProfile.initProfilesForDevice(GLProfile.java:1203)
at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1172)
at javax.media.opengl.GLProfile.access$000(GLProfile.java:66)
at javax.media.opengl.GLProfile$1.run(GLProfile.java:107)
at java.security.AccessController.doPrivileged(Native Method)
at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:105)
at javax.media.opengl.GLProfile.validateInitialization(GLProfile.java:1304)
at javax.media.opengl.GLProfile.getDefaultDesktopDevice(GLProfile.java:1291)
at javax.media.opengl.awt.GLCanvas.<clinit>(GLCanvas.java:86)
at openGLIntro.drawRedSquare.SimplePolygon.<init>(SimplePolygon.java:21)
at openGLIntro.drawRedSquare.SimplePolygon.main(SimplePolygon.java:62)
This happens on the line where I construct a GLCanvas:
private GLCanvas myCanvas;
....
myCanvas = new GLCanvas();
I'm using JOGL version jogl-2.0-b4-20101125-windows-i586.
I've searched the form for relevant things but come up empty (although I'm new to the forum and may have missed something).
Update: sometimes it helps to just walk away for a while :)
I realized that one source of such a problem would be linking at runtime to an incorrect JOGL library. Sure enough, I still had a JOGL 1.1.1a reference in my classpath. Updating that to point to JOGL 2 fixed the problem.
Yes, you fixed on your own one of the biggest sources of problems we see here We usually advise people to unset CLASSPATH entirely, and to make sure they don't have old JOGL versions copied into their JRE directory either. Saves lots of debug time