stefan de boer
stefan de boer

Reputation: 405

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

Upvotes: -1

Views: 222

Answers (2)

stefan de boer
stefan de boer

Reputation: 405

I gave up on trying to get the Leap Motion to work on my Mac Pro M1. I tried @George Profenza his answer and it worked on Windows 10.

After this i had connection issues with the Leap Motion camera because i had to install an older SDK. I Finally got everything working after this article on the Leap Motion forum. Apparantly i had to dive into the Leap folder structure and manually install some extra drivers.

https://forums.leapmotion.com/t/leap-motion-controller-wont-connect-for-2-3-1-but-will-for-4-0-0/8517

Upvotes: 0

George Profenza
George Profenza

Reputation: 51867

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();
  }
}

Upvotes: 1

Related Questions