R Sumesh Manjunath
R Sumesh Manjunath

Reputation: 75

Append java.library.path in command line

-Djava.library.path="path to a dll"

This replace the environment path variable in the current session. I want to append this path to the already existing path.

Kindly let me know how to do it. I'm calling a jar from command prompt using

java -Djava.library.path="path to a dll" -jar myjar.jar

Upvotes: 1

Views: 4838

Answers (2)

rboc
rboc

Reputation: 354

  1. On Windows: Add the path to the library to the PATH environment variable.
  2. On Linux: Add the path to the library to the LD_LIBRARY_PATH environment variable.
  3. On Mac: Add the path to the library to the DYLD_LIBRARY_PATH environment variable.

java.library.path is initilized with the values of the variables above on its corresponding platform.

You can test if the value is what you expect by calling java -XshowSettings:properties

Upvotes: 1

Sainik Kumar Singhal
Sainik Kumar Singhal

Reputation: 801

You can try -Djava.library.path="%PATH%;path to a dll" or if it does't work you need to get existing PATH variable value and add you path to it.

Upvotes: 1

Related Questions