1
-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

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1
  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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.