Random header image at labs.ghostinteractive.net

processing.video on OSX 10.6 with Eclipse

February 7th, 2010  |  Published in Processing  |  by Jeremy

Using the processing.video.* package w/ Eclipse on w/ Snow Leopard requires a couple of extra steps to make things run smoothly. The following will explain how to go about making it work. This post does not cover how to create a Processing project in Eclipse. If you are looking for that info go here: http://processing.org/learning/tutorials/eclipse/

The first step is to link the Processing video.jar file to your project. The following outlines how to go about it (assuming you’ve already created your project).

  1. Navigate to /Application/Processing/
  2. Right click the Processing icon and choose Show Package Contents (opens new Finder window)
  3. Navigate to Resources/Java/libraries/video/library/
  4. Copy the file called video.jar
  5. Navigate to your Processing project
  6. Create a folder called lib (can be called anything you want) and paste the video.jar file there
  7. Back in Eclipse, right click your project file and choose Properties
  8. From the list on the left choose Java Build Path
  9. Click the Libraries tab
  10. Click the Add JARs… button
  11. Navigate to the lib folder where you pasted the video.jar file
  12. Select the video.jar file and press OK
Java Build Path Dialog

Project Preferences: Java Build Path Dialog

Select JAR Dialog

Select JAR Dialog

This should enable you to import the video package into your project. Now… if you are running Snow Leopard there is another step that you need to follow otherwise when you try to instantiate either a Capture or MovieMaker object your app will crash w/ an error containing the following message:

Caused by: java.lang.UnsatisfiedLinkError: /System/Library/Java/Extensions/libQTJNative.jnilib: no suitable image found. Did find: /System/Library/Java/Extensions/libQTJNative.jnilib: no matching architecture in universal wrapper

The reason you are seeing this error is that the Java install shipped w/ Snow Leopard will, by default, open a 64-bit version of the JVM and the processing.video.* package has some dependencies on the 32-bit JVM. I am not clear on the details of the dependency but it is clear that this crash is due to a difference between the JVMs.

Here are the steps to fixing this problem:

  1. Right click your project file and choose Properties
  2. Choose Run/Debug Settings from the list on the left
  3. There should be at least one build configuration in the launch configurations list, choose it and click the Edit button
  4. Click the Arguments tab
  5. In the VM arguments field and this-d32 and click the OK button
Run/Debug Settings Dialog

Project Preferences: Run/Debug Settings Dialog

Edit Run Configuration Dialog

Edit Run Configuration Dialog w/ Arguments

Now that you have included this argument Java will open your app in a 32-bit version of the virtual machine without problems. I’m sure there is a way to make this the default behavior for Java applications, but because this problem is specific to Processing I prefer to just set the preferences on a per project basis.

Leave a Response

About labs.ghostinteractive.net

A hub for the experiments, hacks and open source ventures of Ghost Interactive . Subscribe via RSS »