nikk nikk - 26 days ago 12
Java Question

How do I set library path as command line arguments in Java

How do I set native library path as a command line argument for Java?

java -server -cp lib/jap -Xmx400M -java.library.path=lib/native
?

Answer
java -server -cp lib/jap -Xmx400M -Djava.library.path=lib/native 

To set a system property for the Java vm, you need to use the -D flag.

-Dproperty=value Sets a system property value. The property variable is a string with no spaces that represents the name of the property. The value variable is a string that represents the value of the property. If value is a string with spaces, then enclose it in quotation marks (for example -Dfoo="foo bar").

Source: https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html