Kinect + Processing + Eclipse

From dftwiki3
Revision as of 14:49, 4 November 2011 by Thiebaut (talk | contribs) (Add the core library to the build path)
Jump to: navigation, search

--D. Thiebaut 15:21, 4 November 2011 (EDT)


This tutorial is just a quick tech-note to install Daniel Shiffman's Processing library and make it work with Eclipse. This tutorial assumes a Mac platform.


System Snapshot

  • Mac OS Lion
  • MacPro
  • Processing 1.5
  • Eclipse Helios Service Release 1

Downloads

  • Get Processing (if you don't have it already)
  • Get Shiffman's openkinect.zip.
  • Install Eclipse if necessary

Steps

New Project

  • Open Eclipse
  • Create a new Java project in Eclipse

Get the Processing core library

  • Right-click (or Ctrl-click) on the project, and click on Import
  • From the import menu, click 'File System
  • Browse through your hierarchy of files and find the core.jar file inside the Processing.app application folder. On my machine, this was located in /Applications/Processing.app/Contents/Resources/Java
  • Click on the box next to core.jar and then click on Finish

Add the core library to the build path

  • Click on the project, right click on it, and select Properties
  • In the Libraries tab, click Add Jar, then open up your project in the new window, and select core.jar.
  • You should have a new library in your build path:


KinectEclipseBuildPath1.png


Add OpenKinect Library and Support Files

  • Unzip the openkinect.zip file in a separate folder.
  • Using the same method described above to import the core.jar file into the project, import the openkinect.jar file from the openkinect.zip archive into the project.
  • Add it to the build path.
  • Open a Terminal window, and cd your way to the folder containing the unzipped openkinect archive. Find libKinect.jnilib library file, and copy it to the Java Extensions folder on your machine.
For me, this was done by typing this in Terminal:
 cp openkinect/library/libKinect.jnilib /Library/Java/Extensions/