We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › JOGL, Mac and Eclipse
Page Index Toggle Pages: 1
JOGL, Mac and Eclipse (Read 3314 times)
JOGL, Mac and Eclipse
Apr 5th, 2007, 10:53pm
 
I just found a solution to the classic problem of trying to run sketches that use OpenGL inside Eclipse on MacOS. The problem is typically that even though you have imported the correct JAR files, it still does not find the native libraries at runtime.

Solution: Ctrl-click on jogl.jar from your package explorer. Select "Properties", then "Native library". This allows you to select a location for the native libraries used by that JAR. Point it to a folder containing the various jnilib files, and you should be just fine.

The native libraries are libjogl_cg.jnilib, libjogl.jnilib and libjogl_awt.jnilib. They can be found in the "libraries > opengl > library" subfolder of your Processing application folder.

Update: Darn. Just realized that I'd missed a previous post about this solution when searching the forums for it. Sorry for the redundancy.
Re: JOGL, Mac and Eclipse
Reply #1 - Apr 12th, 2007, 11:50am
 
Hello,

I'm desperately trying to do the same thing and can't get it to work!!!

In your Eclipse project do you have -
core.jar
opengl.jar
and
jogl.jar with native library pointing to the jogl files (everything in the opengl > library folder except opengl.jar and jogl.jar?)
?

I have  another related problem.
I can't get it to see the data folder properly.
where is the best place to put it?

any help would be great!
thanks jeff
Re: JOGL, Mac and Eclipse
Reply #2 - Apr 12th, 2007, 12:51pm
 
Hi, the following settings work for me (OSX):

I have the three libs (core, opengl and jogl) in my project and add the following line to the VM Arguments:

Code:

-Djava.library.path=/Applications/Processing0122/libraries/opengl/library


This are my import statements:

Code:

import javax.media.opengl.GL;
import processing.core.*;
import processing.opengl.*;


For a little bit more convenience I've put all this jar in a user library so I need only add this one to my projects. Also it's easier to update one core.jar at the user lib then in all my projects.

Ahh, and the data folder is located in my source folder.
Re: JOGL, Mac and Eclipse
Reply #3 - Apr 12th, 2007, 1:42pm
 
Thanks for your quick response Eskimoblood.

I tried exactly what you said, but unfortunately it still doesn't work...

I've included the beginning of the error message.
Could it be that I'm using the wrong JVM?
I've tried 1.5, 1.4.2

It would be so great if it would work!

Thanks again for the help,
Jeff

java.lang.RuntimeException: java.lang.NullPointerException

at processing.opengl.PGraphicsOpenGL.requestDisplay(PGraphicsOpenGL.java:172)

at processing.core.PApplet.run(PApplet.java:1450)

at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.NullPointerException

at processing.core.PApplet.pushMatrix(PApplet.java:7439)
Re: JOGL, Mac and Eclipse
Reply #4 - Apr 13th, 2007, 5:29pm
 
Another element to my dilemma. Seems to be something simple to someone who is more java-savvy than I.

next to -
import javax.media.opengl.GL;
import processing.opengl.*;

there is a little error message -

The import javax.media.opengl.GL is never used
The import processing.opengl is never used

but I do use them and have a
public class Machin extends PApplet{ call.

Any pointers?

thanks,
jeff
Re: JOGL, Mac and Eclipse
Reply #5 - Apr 14th, 2007, 12:13am
 
Those messages make sense since the compiler can't see that you are invoking the OpenGL classes. Processing sets up the renderer dynamically. The renderer classes aren't instantiated directly, hence a smart IDE might think they're not in use.

Does the code compile?
Re: JOGL, Mac and Eclipse
Reply #6 - Apr 14th, 2007, 3:41pm
 
hello, v3ga showed me that the setup (eskimoblood's) actually worked with a very simple file. As my projet is a bit unweidly (yet works in prcessing), lots of different classes, I'm going to try to simplify until I spot the error.

Although it seems to be when I instantiate a class that uses opengl that things go haywire.

Thanks for your help.
Jeff
Page Index Toggle Pages: 1