Importing processing core.jar file eclipse rcp

edited May 2014 in How To...

Hi,

I have been using processing to display information within the eclipse RCP framework.

With the 1.5.1 version of processing I only need to include the processing core.jar but now that I am trying to update to the latest version of processing I get an error.

Short version

I get this error when trying to run processing within eclipse rcp.

Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\USERNAME\Desktop\eclipse\gluegen-rt.dll

long version

After I update just the core jar from 1.5.1 to 2.1.2 I got this stack trace :

java.lang.NoClassDefFoundError: javax/media/opengl/awt/GLCanvas
    at processing.opengl.PGraphicsOpenGL.createPGL(PGraphicsOpenGL.java:1744)
    at processing.opengl.PGraphicsOpenGL.<init>(PGraphicsOpenGL.java:518)
    at processing.opengl.PGraphics3D.<init>(PGraphics3D.java:37)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at processing.core.PApplet.makeGraphics(PApplet.java:1917)
    at processing.core.PApplet.size(PApplet.java:1769)
    at processing.core.PApplet.size(PApplet.java:1740)
    at com.blackthorne.cube.view.main.ProcessingMainView.setup(ProcessingMainView.java:108)
    at processing.core.PApplet.handleDraw(PApplet.java:2359)
    at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:240)
    at processing.core.PApplet.run(PApplet.java:2254)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.media.opengl.awt.GLCanvas cannot be found by com.blackthorne.cube.view_1.1.0.qualifier
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 15 more
Exception in thread "Animation Thread" java.lang.RuntimeException: javax/media/opengl/awt/GLCanvas
    at processing.core.PApplet.makeGraphics(PApplet.java:1942)
    at processing.core.PApplet.size(PApplet.java:1769)
    at processing.core.PApplet.size(PApplet.java:1740)
    at com.blackthorne.cube.view.main.ProcessingMainView.setup(ProcessingMainView.java:108)
    at processing.core.PApplet.handleDraw(PApplet.java:2359)
    at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:240)
    at processing.core.PApplet.run(PApplet.java:2254)
    at java.lang.Thread.run(Unknown Source)

I believe the cause of this error is because I do not have related jar files necessary, so I added all of the processing jars from 2.1.2 to the build path.

Now I get an error with the stack trace

Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\USERNAME\Desktop\eclipse\gluegen-rt.dll
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.load0(Unknown Source)
    at java.lang.System.load(Unknown Source)
    at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:551)
    at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:64)
    at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:96)
    at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:414)
    at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:388)
    at com.jogamp.common.os.Platform$1.run(Platform.java:209)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.jogamp.common.os.Platform.<clinit>(Platform.java:179)
    at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:83)
    at processing.opengl.PJOGL.initSurface(PJOGL.java:250)
    at processing.opengl.PGraphicsOpenGL.initPrimary(PGraphicsOpenGL.java:6306)
    at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1653)
    at processing.core.PApplet.run(PApplet.java:2254)
    at java.lang.Thread.run(Unknown Source)

I've tried both the 64 bit and 32 bit processing jars. If I switch back to 1.5.1 jar of processing, the program works again. the jre is 1.7 operating system: 64-bit windows 7

I'm not sure where to look so if anyone has insight on this problem it would be greatly appreciated. Thanks!

Tagged:

Answers

  • Did you sketch use to run in P3D? Cause P3D is OpenGl now. Did you copy the non jar files as well? Like gluegen-rt.dll?

  • edited May 2014

    I did use P3D. When you say did I copy the non jar files, do you mean in the core/library folder or all the files that relate to processing?

    I only copied all of the files that were in the core/library folder. I was unable to find gluegen-rt.dll within processing 2.0 or later. I was able to find gluegen-rt.dll in processing 1.5.1 though (processing-1.5.1\modes\java\libraries\opengl\library\windows32).

    Thanks

  • Answer ✓

    Perhaps the How I can make a sketch with libraries in Eclipse? article can give some hints.

    And avoid to reject answers when they are useful.

  • I apologize. I clicked reject because I still didn't have a solution - my misunderstanding. Thanks clankill3r and PhiLho for the help!

    The tutorial works fine for a normal java project in eclipse. Since the application I'm working on has to work on other developer's computers, I couldn't simply link to the native folder on my machine.

    I created a folder within the plugin project and stored all the jars there. With Processing 1.5.1 I used P3D and didn't need the OpenGL jars, but with Processing 2 and later, we obviously do.

    To get gluegen-rt and jogl-all working (in eclipse RCP) it takes a little more work then the core.jar

    To get the jars working with a plugin project I used 7zip to extract the actual gluegen-rt jar and the jogl-all jar (outside of eclipse). This allowed me to copy and paste the dll files to the root of the plugin which solved the problem of not being able to find the .dll files.

    on a side note, make sure you add the jars to the class path using the runtime tab in your project's manifest (or configure build path if you prefer).

    helpful resources: blog page explaining jogl and RCP http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/

    Here is a youtube video showing the steps of setting up Jogl with eclipse RCP

    Instead of using the latest jogl/gluegen jars as the video suggests, I used the jars that came with processing.

    Once again, thanks PhiLho and clankill3r for the help

Sign In or Register to comment.