Home > DeveloperSection > Forums > How we tell programmatically if I'm running in 64-bit JVM or 32-bit JVM
naomi burke
naomi burke

Total Post:28

Points:196
Posted on    August-11-2015 11:55 PM

 Java Java  Javac 
Ratings:


 1 Reply(s)
 464  View(s)
Rate this:
How can I tell if the JVM my application runs in is 32 bit or 64-bit? Specifically, what function or preference do I access to detect this within the program?


Mayank Tripathi
Mayank Tripathi

Total Post:397

Points:3117
Posted on    August-12-2015 6:29 AM

Sun has a Java System property to determine the bitness of the JVM: 32 or 64:

sun.arch.data.model=32 // 32 bit JVM
sun.arch.data.model=64 // 64 bit JVM
You can use

System.getProperty("sun.arch.data.model") 
to determine if its 32/64 from the program.

Don't want to miss updates? Please click the below button!

Follow MindStick