nikk nikk - 1 year ago 107
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 Source
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").


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download