Help Setting up JOGL and an error with SimpleScene.java

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Help Setting up JOGL and an error with SimpleScene.java

paulthepoptart
Hello, I am new to OpenGL. I am using osX 10.8 (Mtn. Lion) and eclipse. As far as I know, I properly setup JOGL and now I am trying to get SimpleSecne to compile and work. However, I have gotten these two errors, though I think I fixed the first one by renaming the package "windows". Any help would be great! :) Thanks!
Also, I do have the Native Library Location set to ~/myname/jogl-2.0-b-mac.../lib  for all of the user library Jars.

First:
Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
	GLProfile cannot be resolved to a type
	GLProfile cannot be resolved
	GLCapabilities cannot be resolved to a type
	GLCapabilities cannot be resolved to a type
	GLCanvas cannot be resolved to a type
	GLCanvas cannot be resolved to a type

	at windows.SimpleScene.main(SimpleScene.java:11)
Second:
Exception in thread "main" java.lang.NoSuchMethodError: com.jogamp.common.jvm.JNILibLoaderBase.addNativeJarLibs(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/String;)Z
	at javax.media.opengl.GLProfile$1.run(GLProfile.java:131)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:122)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:151)
	at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1688)
	at javax.media.opengl.GLProfile.get(GLProfile.java:652)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:478)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:486)
	at windows.SimpleScene.main(SimpleScene.java:11)
Here's a picture:
Reply | Threaded
Open this post in threaded view
|

Re: Help Setting up JOGL and an error with SimpleScene.java

Wade Walker
Administrator
The first problem ("GLProfile cannot be resolved to a type") just sounds like your SimpleScene project doesn't properly reference the JOGL user library you created. That's the error I'd expect when you refer to a class that you didn't include the JARs for. Not sure why renaming your project package would have helped this :)

Not 100% certain of the second problem, but you don't have to set the native library location for the user library JARs. At runtime, JOGL will look for the natives JARs in the same directory as jogl.all.jar and gluegen-rt.jar all by itself, with no need for setting java.library.path.
Reply | Threaded
Open this post in threaded view
|

Re: Help Setting up JOGL and an error with SimpleScene.java

gouessej
Administrator
In reply to this post by paulthepoptart
Hi

Unset the native library location, maybe there is something wrong with it. You should switch to the latest version of JOGL 2.0 RC10 and don't forget to replace jogl.all.jar by jogl-all.jar. Best regards.

Edit.: If it doesn't work, try to add gluegen-rt.jar and jogl-all.jar into your classpath, look at "Java Build Path" in Eclipse. Ensure the JARs whose names contain "natives" are in the same directory than their Java libraries.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Help Setting up JOGL and an error with SimpleScene.java

paultheopotart
Okay, I unset the native lib location and I'm still getting the error, where exactly would I find JOGL 2.0 RC10? I tried to download the most current version I could find.
Reply | Threaded
Open this post in threaded view
|

Re: Help Setting up JOGL and an error with SimpleScene.java

gouessej
Administrator
Hi

This version has been released August 26th, 2012:
http://jogamp.org/deployment/archive/master/gluegen_584-joal_353-jogl_798-jocl_668/

Please try my second suggestion (add gluegen-rt.jar and jogl-all.jar into your classpath, look at "Java Build Path" in Eclipse. Ensure the JARs whose names contain "natives" are in the same directory than their Java libraries).
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Help Setting up JOGL and an error with SimpleScene.java

Md. Firoze Hossain
In reply to this post by paulthepoptart
I have set up jogl and glugen properly for using java graphics...but  a problem has occurred a lot of times...such as " A JNI  error has occurred , please check your installation and try again" and " a java exception has occured"... I don't know what should I do now?
Reply | Threaded
Open this post in threaded view
|

Re: Help Setting up JOGL and an error with SimpleScene.java

gouessej
Administrator
Are you sure that you followed these instructions?
https://jogamp.org/wiki/index.php?title=Setting_up_a_JogAmp_project_in_your_favorite_IDE
Julien Gouesse | Personal blog | Website