简体   繁体   中英

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?

You can set it on the command line thus:

java -Djava.library.path=...

and point it to the directory containing the relevant library.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM