« Previous | Next »
Advanced Processing in Eclipse
Published on Mar. 24, 2009
by Kyle
Processing is an excellent framework and is at the top of my list of recommendations when it comes to tools for development, close to it is Eclipse (a very powerful coding IDE). One of the most beneficial assets to Processing is its learning curve. It takes seconds for someone with no programming experience to create their first “sketch” and advanced users tend to segway into more direct java programming. Because Processing was built as a learning tool the IDE leaves something to be desired for advanced users; my biggest complaint is the inability of creating reusable classes without having multiple copies. This is where Eclipse allows you to really take your development to another level.
Eclipse is an extendable IDE, developed in Java, originally for Java. I use Eclipse for nearly every development task; of course I use it for all Java/Processing work, I use a plugin called FDT for my ActionScript programming, PHPEclipse for any PHP and adobe even has a nice JavaScript editor for Eclipse. The Eclipse environment offers plenty of great features, that I now dread working without, but for most, it is not a user-friendly learning process. The incredible Daniel Shiffman has posted an excellent tutorial on getting Processing in Eclipse. It covers most of what is needed to know, but its never as easy as it looks so I thought I would mention some things you are likely to run into.
- In Processing, number datatypes are usually just int or float, it is important to know that in Java double is another datatype (similar to a float) that is very common, you may find yourself casting between these frequently. Secondly when entering values expecting a floating-point number add a lowercase ‘f’ to the end (i.e. 1.52f) to make sure the value is read as a float and not a double.
- Make sure you are using Eclipse Ganymede, if you are not you must install FatJar. GanyMede has FatJar built-in, but previous versions of Eclipse would not export working applications, the Processing libraries would not be included in the jar file, it would test fine but never export correctly.
- Getting JOGL (Java OpenGL) to work can be tricky. First make sure you are passing OPENGL in as the third parameter in your size() call. In the end, I got it working by adding jogl.jar and and gluegen-rt.jar from Processing/libraries/opengl/library folder. Then the least obvious part: In your “Run Configuration” for your project, click on arguments, where it says “VM Arguments” write “-Djava.library.path=/documents/Processing/libraries/opengl/library” where the path is your correct path to your opengl library directory. This will make Eclipse see the .dll files in this directory and add them to its libary path, at this point you should be able to compile successfully.
I also found this great hack for using pure JOGL hacks: pure-jogl
UPDATE: – after writing this I still ran into some difficulty getting applications to launch after they were exported as a runnable jar. I found this http://www.rednoise.org/EclipseP5Exporter/ and it solved my problem and brought a familiar Processing-style export to Eclipse that I really appreciate.
Leave a response
Trackback URL: Advanced Processing in Eclipse.






Comments on Advanced Processing in Eclipse
One Response
Fullscreen Solutions for Processing | labs.hapticdata.com
27/09/11
[...] in Processing. If you are unfamiliar with Eclipse, you may want to look at this posting I wrote: Advanced Processing in Eclipse. In my opinion, this technique is the most valuable for Processing users to know. This solution is [...]
Leave a Reply