Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine if a JRE is 32/64bit from folder structure/files

Tags:

java

I have a JRE folder on a Windows system. Is there a way to determine if the JRE is 32-bit or 64-bit from looking at the files within?

To clarify, I have multiple JRE folders and I want to investigate each.

This is not a duplicate of the suggested duplicate. I wish to know which arch the JRE is designed for, not the arch of the machine it is installed on

like image 548
Mark W Avatar asked Oct 24 '25 03:10

Mark W


2 Answers

You can examine the release file in the Java root directory, and look at the OS_ARCH. These are the contents on my Windows 8 machine; for the 64-bit it is 'AMD64' while for 32-bit it is 'i586'.

64 bit:

JAVA_VERSION="1.8.0_31"
OS_NAME="Windows"
OS_VERSION="5.2"
OS_ARCH="amd64"
SOURCE=" .:fde671d8b253 corba:f89b454638d8 deploy:6bb9afd737b2 hotspot:4206e725d584 hotspot/make/closed:3961887b77fc hotspot/src/closed:5b436b7ac70c hotspot/test/closed:63646d4ea987 install:b2307098361c jaxp:1dd828fd98f1 jaxws:9d0c737694ec jdk:1fbdd5d80d06 jdk/make/closed:ebe49cb8785a jdk/src/closed:ef076fdb2717 jdk/test/closed:ab9c14025197 langtools:7a34ec7bb1c8 nashorn:ec36fa3b35eb pubs:532faa86dd91 sponsors:477c30a7726d"
BUILD_TYPE="commercial"

32 bit:

JAVA_VERSION="1.8.0_31"
OS_NAME="Windows"
OS_VERSION="5.1"
OS_ARCH="i586"
SOURCE=" .:fde671d8b253 corba:f89b454638d8 deploy:6bb9afd737b2 hotspot:4206e725d584 hotspot/make/closed:3961887b77fc hotspot/src/closed:5b436b7ac70c hotspot/test/closed:63646d4ea987 install:b2307098361c jaxp:1dd828fd98f1 jaxws:9d0c737694ec jdk:1fbdd5d80d06 jdk/make/closed:ebe49cb8785a jdk/src/closed:ef076fdb2717 jdk/test/closed:ab9c14025197 langtools:7a34ec7bb1c8 nashorn:ec36fa3b35eb pubs:532faa86dd91 sponsors:477c30a7726d"
BUILD_TYPE="commercial"

Alternatively, go to the bin folder and execute java -version.

like image 93
Glorfindel Avatar answered Oct 27 '25 00:10

Glorfindel


System.getProperty("sun.arch.data.model");

If you only have a JRE, visit this shows the sun.arch.data.model.

like image 36
Jordi Castilla Avatar answered Oct 26 '25 23:10

Jordi Castilla