This post was updated on .
I am developing an Eclipse RCP application in RHEL using a jogl-dependent mapping application.
Initially, I had all the jogl related jars in the map plug-in directly, but I receive this exception: JAR URL doesn't start with 'jar:', got <bundleresource ...> Therefore, following some tutorials, I put the jogl.all.jar and gluegen-rt.jar in one plug-in and made a linux-specific fragment containing the native jars; additionally I added -Djogamp.gluegen.UseTempJarCache=false to the VM arguments. Then I receive this exception: java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.path I attempted to add the extracted .so files location to the path using -Djava.library.path, but I receive this exception: javax.media.opengl.GLException: Profile GL2ES2 is not available on null, but: [] Doing some other reading I know the "but" statement should include some available profiles, but it appears that I have none! I have attacked this problem from every angle thinkable (and google-able). Can anyone help me? Underlying problem: I had installed nvidia drivers at one point because the resolution of my screen was so terrible. This somehow messed up OpenGL. After uninstalling the nvidia driver OpenGL was happy again. To check if OpenGL is happy run: glxinfo | grep render. You should get some output saying OpenGL is the renderer. |
Administrator
|
There are two good ways to use JOGL in an Eclipse RCP app.
Way #1: Do it like in my tutorial at http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/. This is the original way where you include .dll/.so/.dylib files directly. It works, but is a bit tedious to set up because of the number of files. Way #2: Create a separate plugin just like in Way #1, but put in native JARs instead of .dll/.so/.dylib files. In this case your plugin contains gluegen-rt.jar, five gluegen-rt-natives-<platform>.jar files, jogl-all.jar, and five jogl-all-natives-<platform>.jar files. There is one trick here: you have to add an URL resolver to your code somewhere, so it can transform bundleresource: URLs to file: URLs. I do it in my main editor control like this: import org.eclipse.core.runtime.FileLocator; ... public void createPartControl( Composite compositeParent ) { JarUtil.setResolver( new JarUtil.Resolver() { public URL resolve( URL url ) { try { return( FileLocator.resolve( url ) ); } catch( IOException ioexception ) { return( url ); } } } ); ... <set up JOGL GLCanvas> } This URL resolver is what lets JOGL find the *-natives-*.jar files from the runtime classspath of the jogl-all.jar file, which is a bundleresource: URL when running inside an Eclipse RCP app. You'll also need to remove -Djogamp.gluegen.UseTempJarCache=false to get this to work, since the temp JAR cache is where JOGL unpacks the .dll/.so/.dylib files at runtime. Please let me know if you have any questions or have trouble getting this to work -- I've done it many times, so it should be functional. |
Thanks for the response Wade.
The Resolver method (Way #2) doesn't work for me since JarUtil.setResolver isn't available with the version of JOGL I am using. Looking again at the tutorial linked for Way #1, I now notice that you have the literal .dll's (.so's in my case) in the fragment, not the native jars, that was possibly my point of failure. Sadly I grew agitated and left work (I was literally the only person in the building). I'll check this out tomorrow and get back to you. |
Administrator
|
Please use the very latest stable version of JOGL and then you'll see JarUtil.setResolver () (in GlueGen). We provide support only for the latest version. We can't help you if you use an obsolete version.
Julien Gouesse | Personal blog | Website
|
In reply to this post by Wade Walker
Well I did Way #1 correctly this time, but it gets me to the same final error as before:
javax.media.opengl.GLException: Profile GL2ES2 is not available on null, but: [] at javax.media.opengl.GLProfile.get(GLProfile.java:655) at javax.media.opengl.GLProfile.getGL2ES2(GLProfile.java:633) ... I have a feeling it has to do with the fact that I am running off the integrated graphics and don't have the necessary drivers for OpenGL to work. |
Thanks for the help Wade. Turns out (as I appended to the original post) that my nvidia driver had messed up OpenGL.
|
Administrator
|
Glad to hear it's working
|
Free forum by Nabble | Edit this page |