$ java -XshowSettings:vm -Xmx512M -version With the -XshowSettings:vm flag, some info is shown about the Java Virtual Machine.Īs you can see in the second example, the amount of maximum heap memory size can be defined with the -Xmx flag. OpenJDK 64-Bit Server VM Zulu19.28+81-CA (build 19+36, mixed mode, sharing) Reading the VM Settings Zh_MO_#Hant, zh_SG, zh_SG_#Hans, zh_TW, zh_TW_#Hant, zh_#Hans, zh_#Hant, zu, In case you didn't know yet, I live in Belgium and use English as my computer language, as you can see when using the -XshowSettings:locale flag: $ java -XshowSettings:locale -versionĭefault display locale = English (Belgium)ĭefault format locale = English (Belgium)Īvailable locales =, af, af_NA, af_ZA, af_ZA_#Latn, agq, agq_CM, agq_CM_#Latn,Īk, ak_GH, ak_GH_#Latn, am, am_ET, am_ET_#Ethi, ar, ar_001,Īr_AE, ar_BH, ar_DJ, ar_DZ, ar_EG, ar_EG_#Arab, ar_EH, ar_ER, It's an internal number used by Java to define the version. If you ever faced the problem of an unsupported Java version 59 (are similar), you'll now also understand where this value is defined, it's right here in this list as. OpenJDK 64-Bit Server VM Zulu19.28+81-CA (build 19+36, mixed mode, sharing) = /Users/frankdelporte/.sdkman/candidates/java/19-zulu/zulu-19.jdk/Contents/Home/lib Java.vm.specification.vendor = Oracle Corporation Java.vm.specification.name = Java Virtual Machine Specification = /Users/frankdelporte/Library/Java/Extensions = /Users/frankdelporte/.sdkman/candidates/java/19-zulu/zulu-19.jdk/Contents/Home Reading the System Propertiesīy using the -XshowSettings:properties flag, a long list of various properties is shown. The cleanest way to call this flag, is by adding -version, otherwise you will get the long Java manual output as no application code was found to be executed. This flag can be called with different arguments, each producing an other information output. ![]() Twitter screenshot of a message by OpenJDK about adding the -XshowSettings flag In 2010, an experimental flag (indicated with the X) was added to OpenJDK to provide more configuration information: -XshowSettings. SOURCE="git:f4b2b4c5882e" Getting More Information With showSettings $ cat /Users/frankdelporte/.sdkman/candidates/java/8.0.332-zulu//release $ cat /Users/frankdelporte/.sdkman/candidates/java/19-zulu/release ![]() Lrwxr-xr-x 1 frankdelporte staff 7 Nov 21 21:09 current -> 19-zuluĪnd in each of these directories a release file can be found which also shows us the version information, including some extra information. On my machine, as I use SDKMAN to switch between different Java versions, all my versions are stored here: $ ls -l /Users/frankdelporte/.sdkman/candidates/java/ĭrwxr-xr-x 15 frankdelporte staff 480 11.0.15-zuluĭrwxr-xr-x 16 frankdelporte staff 512 17.0.3.fx-zuluĭrwxr-xr-x 15 frankdelporte staff 480 18.0.1-zuluĭrwxr-xr-x 15 frankdelporte staff 480 Sep 7 18:36 19-zuluĭrwxr-xr-x 18 frankdelporte staff 576 8.0.332-zulu The above output results from info read by the java executable from a file inside its installation directory. OpenJDK 64-Bit Server VM Zulu19.28+81-CA (build 19+36, mixed mode, sharing) Checking Version Files in the Installation Directory OpenJDK Runtime Environment Zulu19.28+81-CA (build 19+36) Probably the easiest way to find the installed version is by using the java -version terminal command: $ java -version Learn moreįrom time to time, you need to check which Java version is installed on your computer or server, for instance when starting on a new project or configuring an application to run on a server.īut did you know there are multiple ways you can do this and even get much more information than you might think, very quickly? Frank Delporte is a Java Champion, Java developer, technical writer at Azul, blogger, author of "Getting started with Java on Raspberry Pi", and contributor to Pi4J.
0 Comments
Leave a Reply. |