How to programmatically check wheather Java is 32 bit or 64 bit

Jun 12, 2016

To check if the JVM of my application runs in 32 bit or 64-bit mode, following are the options\n

Checking Programmatically

If you want to check programmatically the Java 32 bit / 64 bit version then Java has system property


This will either return 32 or 64. , Then you can decide JVM bit version

Checking at command line

run command java -version

C:\>java -version 
java version "1.8.0_73"Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)
if you see 64-Bit in the third line, then it is 64 bit Java otherwise it is 32 bit Java.

comments powered by Disqus

© Copyright 2022