javaprocessingclasspathleap-motion

How to set CLASSPATH to use Leap Motion in Processing?


I am trying to use the Leap Motion tracking device in Processing 4. I added the LeapJava library but whenever i try to run my project i get this error message:

Native code library failed to load. 
java.lang.UnsatisfiedLinkError: no LeapJava in java.library.path:

Since i am a beginner i do not understand or know how i can add the LeapJava.jar to my class path. I hope someone can explain how i can do this so my project will run.

I already tried following these two tutorials but i cannot seem to get it working:

https://developer-archive.leapmotion.com/documentation/v2/java/devguide/Project_Setup.html

https://developer-archive.leapmotion.com/documentation/java/devguide/Leap_Processing.html


Solution

  • Have you tried the Darius' Leap Motion Processing Library ?

    You should be able to install it via Processing > Sketch > Import Library... > Add Library... > which opens Contribution Manager (from there you can search "leap")

    Leap Motion for Processing library logo: the pocessing logo and Leap Motion logo next to each other

    import de.voidplus.leapmotion.*;
    
    LeapMotion leap;
    
    void setup() {
      size(800, 500);
      background(255);
      
      leap = new LeapMotion(this);
    }
    
    void draw() {
      background(255);
      
      for (Hand hand : leap.getHands ()) {
        hand.draw();
      }
    }