How to Set Java Library Path for Processing

How to Set Java Library Path for Processing

I'm using PDE to run a Processing sketch, and I get the following error:

Verify that the java.library.path property is correctly set.

Could anyone of you tell me how to solve this problem?

5 Answers

You can set it on the command line thus:

java -Djava.library.path=... <existing arguments (classpath, name of class to run etc.)>

and point it to the directory containing the relevant library.

3

In Eclipse, I did this to get OpenCV working:

  1. In the Run menu, select Run Configuration.
  2. Go to the (x)=Arguments tab of your sketch.
  3. Add this in the VM arguments field:

    -Djava.library.path="/path/to/OpenCV/library"
    

Before System.loadLibrary(""), use the following code to check you java.library.path

System.out.println(System.getProperty("java.library.path"));

Generally,the java.library.path=/usr/java/packages/lib/i386:/usr/lib/jni:/lib:/usr/lib

Provides several options for:

  • $ sudo cp libxxx.so /usr/lib/jni
  • java -Djava.library.path=path of so xxx
1

Your library.path is fine, what you need to do is to drop prefix lib and suffix .so from your System.loadLibrary( "..." ). On Linux or "linux-android" those will be automatically added by JVM.

Conclustion of above all answers (short form) is as follows:

Lets say my lib folder path is lib/

Then to add in the library path: run below command:

java -Djava.library.path=lib/ -jar  mySampleJar.jar

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.