Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java VM Options: Set a -Djava.library.path relative to project folder

Tags:

java

jvm

I would like to set the -Djava.library.path VM option to a specific folder. However, it is not relative to my project folder so that I could say for example:

-Djava.library.path=native\windows

(The folder native is in the project folder.)

Do you know if this is somehow possible to set it like above and not with -Djava.library.path=C:\...?

like image 1000
st.math Avatar asked Jan 03 '15 12:01

st.math


1 Answers

You actually can set a relative path. For example if you start your program a specific folder, you can access libraries in a folder "libs" right next to it by setting the path to "../libs" e.g.

In my own project with native libraries I have this in my shell script:

-Djava.library.path=../../native/unix

Hope this answers your question.

like image 179
sorencito Avatar answered Oct 13 '22 17:10

sorencito