HOW WE TELL PROGRAMMATICALLY IF I'M RUNNING IN 64-BIT JVM OR 32-BIT JVM

naomi burke

Total Post:28

Points:196
Posted by  naomi burke
Java  Javac 
 755  View(s)
Ratings:
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?
  1. Mayank Tripathi

    Post:397

    Points:3117
    Re: How we tell programmatically if I'm running in 64-bit JVM or 32-bit JVM

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!