How to find if java.exe is 32-bit or 64-bit?

15,256

Solution 1

You can run C:\ProgramData\Oracle\Java\javapath\java.exe -version. Among the details it prints out, you should see whether it's a 32 or 64 bit version.

A 32 bit version will return something about a "Client VM" or "Server VM", and a 64 bit version will state so explicitly.

E.g., the output of my machine (admittedly, a Fedora 25, but the principle should stand):

openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-b14)
OpenJDK 64-Bit Server VM (build 25.121-b14, mixed mode)

Solution 2

You could check os.arch

System.out.println(System.getProperty("os.arch"));

32 bit architecture is typically represented by x86_32 or just x86, 64 bit architecture by x86_64

Share:
15,256
srh
Author by

srh

Updated on June 04, 2022

Comments

  • srh
    srh almost 2 years

    I have a laptop with Windows 7 Professional 64-bit operating system.

    It has a C:\ProgramData\Oracle\Java\javapath folder which contains java.exe. How can I know if this JVM is 32-bit or 64-bit?

    I right-click on it and open Properties window and under Detail tab the File version is 8.0.1210.13. But there is no information if it is 32-bit or 64-bit.