Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default Java library path?

I understand that you can set the Java library path with an option (-Djava.library.path=/path/to/libs) before executing the program, but is there a place on the system where Java looks if you don't set it manually?

like image 790
2mac Avatar asked Nov 18 '13 01:11

2mac


People also ask

What is the default java library PATH?

Its default value depends on the operating system: On Windows, it maps to PATH. On Linux, it maps to LD_LIBRARY_PATH. On OS X, it maps to DYLD_LIBRARY_PATH.

Where is the java library PATH?

If you have single native libs in your project, there is another way you can do it. Go to Project properties->Java Build Path->Source. You'll find a list of source-folders. Each entry under the the Source tab has Native library locations.

How do I find the java library?

Step 1: Right-click the project and select “Build Path » Add Libraries…”. Step 2: Dialog the window that pops up, select “User Library” and click the “Next” button. Step 3: Select the user libraries you want to add and click “Finish”.

Where is java library PATH in Linux?

Use java -XshowSettings:properties to show the java. library. path (and others) value. Thanks Jose, this helped me.


2 Answers

Its default value depends on the operating system:

  • On Windows, it maps to PATH
  • On Linux, it maps to LD_LIBRARY_PATH
  • On OS X, it maps to DYLD_LIBRARY_PATH
like image 108
Matt Ball Avatar answered Oct 05 '22 02:10

Matt Ball


However, Matt Ball is not totally correct.

On my Linux box, my Java library path is

/usr/lib64/icedtea6/jre/lib/amd64/server:/usr/lib64/icedtea6/jre/lib/amd6ib/amd64:/usr/lib64:/lib64:/lib:/usr/lib 

While my LD_LIBRARY_PATH is /usr/local/lib64.

like image 36
Yichao Zhou Avatar answered Oct 05 '22 02:10

Yichao Zhou