Issue Exporting .app Using Processing and Leap Motion SDK

526 Views Asked by At

I have been trying to export a standalone application for Mac using the "Export Application" function in Processing. The simple application, which involves updating a float value on the screen that corresponds to the y-axis position of a hand detected by a Leap Motion, works perfectly well within Processing. However, once I export the application and try to run it, the app opens for a brief second and quickly closes. I have exported applications from Processing successfully before, but not one that uses the Leap SDK. I am using the LeapMotion library for Processing to access the Leap SDK: https://github.com/heuermh/leap-motion-processing. Here is my code:

import processing.core.*;
import com.leapmotion.leap.processing.*;
import com.leapmotion.leap.Controller;
import com.leapmotion.leap.Listener;

public class Test extends PApplet {

  Controller controller;
  MyListener listener;
  float position = 0.0f;

  class MyListener extends Listener {
    public void onFrame(Controller controller) {
      if (!controller.frame().hands().isEmpty()) {
        position = controller.frame().hands().leftmost().palmPosition().get(1);
      }
    }
  }

  public void setup() {
    size(600,600);
    controller = new Controller();
    listener = new MyListener();
    controller.addListener(listener);
  }

  public void draw() {
    background(0);
    textAlign(CENTER,CENTER);
    textSize(50);
    text(position, 300,300);
  }

  public static void main(String args[]) {
    PApplet.main("Test");
  }
}

When I export the application, the contents of the application are as follows:

Info.plist
Java
-core.jar
-gluegen-rt-natives-macosx-universal.jar
-gluegen-rt.jar
-jogl-all-natives-macosx-universal.jar
-jogl-all.jar
-LeapJava.jar
-LeapMotion.jar
-libLeap.dylib
-libLeapJava.dylib
-Test.jar
MacOS
-Test
Plugins
-jdk1.7.0_45.jdk
Resources
-en.lproj
-sketch.icns
PkgInfo

Any help would be greatly appreciated!

P.S. I've already tried bundling the program into a runnable JAR file.

0

There are 0 best solutions below