Multiple directories in -Djava.library.path
On Linux, use colon : as separator (as you will do with the classpath option) as in: -Djava.library.path=/opt/hdf-java/build/bin:/opt/opencv-2.4.10/build/lib
On Linux, use colon : as separator (as you will do with the classpath option) as in: -Djava.library.path=/opt/hdf-java/build/bin:/opt/opencv-2.4.10/build/lib
JDK_JAVA_OPTIONS is only picked up by the java launcher, so use it for options that you only want to apply (or only make sense for) the java startup command. This variable is also new on JDK 9+, and will be ignored by earlier JDK versions. Hence, it’s useful when migrating from older versions to 9+. … Read more
You can set set environment variable JAVA_TOOL_OPTIONS in your OS. All Java tools (java, javac, ..) will pick this variable up and use it. So you could e.g. use SET JAVA_TOOL_OPTIONS=-Dsun.locale.formatasdefault=true I use this to force a specific locale for each JVM. But this only works if your application is started through the Java tools. … Read more
From sun.misc.VM, it’s Runtime.getRuntime.maxMemory(), that’s what is configured with -Xmx. E. g. if you don’t configure -XX:MaxDirectMemorySize and do configure -Xmx5g, the “default” MaxDirectMemorySize will also be 5 Gb, and the total heap+direct memory usage of the app may grow up to 5 + 5 = 10 Gb.
There is no performance benefit of setting java.awt.headless=true if you’re not using AWT features. AWT features are loaded on-demand. As explained in the linked article, headless mode is useful for accessing some Java graphics features which are normally delegated to the graphics host: After setting up headless mode and creating an instance of the headless … Read more
Default values for JDK 1.6.0_29 on Windows 7/32-bit: -Xmx256m -XX:MaxPermSize=64m Also value of these option can be printed by following command: java -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version 2>&1 Then look for MaxHeapSize and MaxPermSize keys and see default values. uintx InitialHeapSize := 199947456 {product} uintx MaxHeapSize := 268435456 {product} uintx MaxPermSize = 67108864 {pd product} Here … Read more
Apparently, _JAVA_OPTIONS works on Linux, too: $ export _JAVA_OPTIONS=”-Xmx1g” $ java -jar jconsole.jar & Picked up _JAVA_OPTIONS: -Xmx1g
I wanted to use this for some program I hadn’t control for running that Java app so ended with this _JAVA_OPTIONS=-Djava.net.preferIPv4Stack=true environment variable. (read about _JAVA_OPTIONS here) If you are using Windows, just run this command on Windows cmd: setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true Thanks to Jason Nichols for reminding this JVM argument 🙂
On Mac, $IDEA_HOME/Contents/Info.plist ~: grep –context=5 Xmx /Applications/Maia-IU-94.426.app/Contents/Info.plist <string>true</string> <key>apple.awt.fullscreencapturealldisplays</key> <string>false</string> </dict> <key>VMOptions</key> <string>-Xms128m -Xmx912m -Dfile.encoding=UTF-8 -XX:MaxPermSize=250m -ea -agentlib:yjpagent=disablej2ee,disablecounts,disablealloc,sessionname=IntelliJIdea90 -Xbootclasspath/a:../lib/boot.jar</string> <key>WorkingDirectory</key> <string>$APP_PACKAGE/bin</string> </dict> </dict> </plist> On Windows/Linux, %IDEA_HOME%\bin\idea.vmoptions
You can setup _JAVA_OPTIONS instead of JAVA_OPTS. This should work without $_JAVA_OPTIONS.