Nerding Out

At Frog I’ve been working on a Processing project which has become fairly involved. I decided to use the Java library xStream and discovered that the “inner classes” situation presented by Processing caused problems with this. Despite there being possible solutions to this within the Processing IDE, I decided to push my dev environment over to Eclipse. It wasn’t too bad, but I had to do some searching to help tie up all the loose ends. I figured I’d post my process to save anyone else who is doing this some time. This is the first of entries that I’ve made of this kind, so feel free to drop a comment if things aren’t clear:

Getting processing running in Eclipse with opengl:

1.right click the main folder and import the following FILES:
-core.jar
-gluegen-rt.jar
-jogl.jar
-opengl.jar

2. also make a data folder in the workspace. right click on the name of the project and choose properties. inside java build path under source add the data folder. this is where you’ll want to put assets for your program if you have them.

3. add jogl and gluegen’s native libraries to the data folder
(gluegen-rt-natives-macosx-universal.jar and jogl-natives-macosx-universal.jar for me, but will vary by os)

4. open a terminal and cd to the data folder and extra the jar files by entering:
jar xf gluegen-rt-natives-macosx-universal.jar
jar xf jogl-natives-macosx-universal.jar

5. in eclipse right click on all the jar files and under Build Path select “Add to Build Path”

6. right click on your project and choose properties. under Java Build Path > Libraries you should see a list of all of your libraries. click the arrow next to Native libarary location and then click edit. select external folder and find the data folder with your extracted native jar files. do the same for gluegen-rt.jar

This information is rehashed from various content on the Processing forums and from the following Processing Hacks page. It was still a bit confusing for me, though, and I figured that it would be useful for some people to have some really basic step directions on how to do i (including opengl). Benefits of coding in Eclipse are:

-Easier Integration of standard Java Libraries
-Code Completion
-Code Re-factoring
-SVN integration
-Debugging Tools

and many more. There’s even a plugin which helps with exporting Processing code.

Here’s some other links that might help with the integration:
Main Tutorial: http://processing.org/learning/tutorials/eclipse/
http://processing.org/discourse/yabb2/YaBB.pl?num=1114400513/

[Edit] As I’ve been spending more time working under this setup I’ve been discovering some basic things which others might find useful so I figured I’d slowly compile them into a list here:

-when printing to console outside of the main class, use PApplet.println(“message”) to avoid the annoying little yellow warning sign that calling it from parent gives you.

-if you want to run your program as an application add the standard:

public static void main(String args[]) {

PApplet.main(new String[] { "--presentation","thenameofyourprogram" });

}

if you don’t want it to open in presentation mode remove the “–presentation”, part.

Tags: , ,

Leave a Reply

Connect with Facebook