4

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

Mark W
  • 5,824
  • 15
  • 59
  • 97
  • With or without reading the file's contents? – Siguza May 15 '15 at 11:38
  • Are you able to run "java -version"? – Glorfindel May 15 '15 at 11:39
  • java -version shows you if it is 64 ore 32 bit – Jens May 15 '15 at 11:40
  • What operating System are you on? Windows? If you are lucky it is installed either in programm files or programm files (x86), which could give a hint. – Thomas Junk May 15 '15 at 11:40
  • @MichaelDibbets It is not windows' arch I need to know, It is the JRE – Mark W May 15 '15 at 11:41
  • Yea, but from within the java code or something else? I am assuming from the java code and then that question is applicable(see second answer). If not, please update your question with specifics from where and how you are reading the folders and for what purpose. – Tschallacka May 15 '15 at 11:42
  • @ThomasJunk That depends on whether the person installing put it in the correct place. Which I believe they didn't. – Mark W May 15 '15 at 11:43
  • @Jens but that is based on the JRE in your java_home right? - I have multiple JRE folders in my system. – Mark W May 15 '15 at 11:44
  • @MarkW add the path in front of java command and you can use every java.exe – Jens May 15 '15 at 11:47
  • "This is not a duplicate of the suggested duplicate." There is no suggested duplicate any more. – Boann Oct 21 '15 at 12:22

2 Answers2

8

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.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
1
System.getProperty("sun.arch.data.model");

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

Jordi Castilla
  • 26,609
  • 8
  • 70
  • 109