[64-bit] How do I detect whether 32-bit Java is installed on x64 Windows, only looking at the filesystem and registry?

I need to determine whether a particular system has 32-bit Java installed. I'm doing a remote query that only gives me access to the filesystem and registry, so I cannot attempt to run java.exe, or run any Java code.

I also want to make sure I detect both IBM and Sun Java, as well as any other distributions, which seem to put things in different places on the filesystem and in the registry.

The best I've come up with is to check for C:\Windows\SysWOW64\java.exe. Is this a reliable way to test for the presence of 32-bit Java, or are there certain versions that won't put java.exe in that folder?

Update: I'm still looking for a more robust answer to this. Just to be clear, I don't have access to a command prompt. Also, I want to detect Java no matter who the publisher is, what version number is installed, and no matter what path the user chose to install it on.

C:\Windows\SysWOW64\java.exe seems to fit these requirements, but I'd love some confirmation from someone more knowledgeable that every Java installer will indeed put that executable there.

This question is related to 64-bit 32-bit java

The answer is


This seems to provide the info on Windows:

1.) Open a windows command prompt.

2.) Key in: java -XshowSettings:all and hit ENTER.

3.) A lot of information will be displayed on the command window. Scroll up until you find the string: sun.arch.data.model.

4.) If it says sun.arch.data.model = 32, your VM is 32 bit. If it says sun.arch.data.model = 64, your VM is 64 bit.


Check this key for 32 bits and 64 bits Windows machines.

 HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment

and this for Windows 64 bits with 32 Bits JRE.

 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment

This will work for the oracle-sun JRE.


If it is not Oracle's Java, you may not be able to tell. When I install Oracle Java 64-bit, the files go into C:\Program Files\Java, but when I install a 32-bit version, they default to C:\Program Files (x86)\Java instead. Of course, the person who installed Java could have overridden those defaults.


just write "java -d64 -version" or d32 and if you have It installed it will give a response with current version installed


Do you have access to the command prompt ?

Method 1 : Command Prompt

The specifics of the Java installed on the system can be determined by executing the following command java -version

Method 2 : Folder Structure

In case you do not have access to command prompt then determining the folder where Java.

32 Bit : C:\Program Files (x86)\Java\jdk1.6.0_30

64 Bit : C:\Program Files\Java\jdk1.6.0_25

However during the installation it is possible that the user might change the installation folder.

Method 3 : Registry

You can also see the version installed in registry editor.

  1. Go to registry editor

  2. Edit -> Find

  3. Search for Java. You will get the registry entries for Java.

  4. In the entry with name : DisplayName & DisplayVersion, the installed java version is displayed


Examples related to 64-bit

Android Studio: /dev/kvm device permission denied How to printf a 64-bit integer as hex? Unable to install Android Studio in Ubuntu I cannot start SQL Server browser Class not registered Error Excel VBA Code: Compile Error in x64 Version ('PtrSafe' attribute required) MSOnline can't be imported on PowerShell (Connect-MsolService error) How to know installed Oracle Client is 32 bit or 64 bit? The application was unable to start correctly (0xc000007b) How to specify 64 bit integers in c

Examples related to 32-bit

Class not registered Error Running vbscript from batch file How do I detect whether 32-bit Java is installed on x64 Windows, only looking at the filesystem and registry? Skipping Incompatible Libraries at compile How do I run a VBScript in 32-bit mode on a 64-bit machine? Are 64 bit programs bigger and faster than 32 bit versions? How can I tell if I'm running in 64-bit JVM or 32-bit JVM (from within a program)? "An attempt was made to load a program with an incorrect format" even when the platforms are the same How to compile a 32-bit binary on a 64-bit linux machine with gcc/cmake Java 32-bit vs 64-bit compatibility

Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log