0

I downloaded JRE first. Then downloaded JDK.

My JRE is in this directory

C:\Program Files (x86)\Java\jre1.8.0_291

My JDK is in this directory

C:\Program Files\Java\jdk-16.0.1

Running java -version command yields the following :

C:\Program Files (x86)\Java\jre1.8.0_291\bin>java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) Client VM (build 25.291-b10, mixed mode, sharing)
C:\Program Files\Java\jdk-16.0.1\bin>java -version
java version "16.0.1" 2021-04-20
Java(TM) SE Runtime Environment (build 16.0.1+9-24)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)

does that mean I have a duplicate JRE?
If so, why there is no JRE in C:\Program Files\Java\ ?

Roo Tenshi
  • 37
  • 8
  • 2
    1) No, you don't have a *duplicate* JRE, you have an different JRE. --- 2) A JDK always includes a JRE embedded as part of the JDK, so there is one. Java 16 doesn't have a dedicated JRE anymore. – Andreas Jul 20 '21 at 15:38
  • The `Program Files (x86)` directory is mostly there for historical purposes, and doesn't require programs within to actually be 32 bit executables. Your `PATH` environment variable likely includes both versions of `Program Files`, so it doesn't really make a difference. – h0r53 Jul 20 '21 at 15:38
  • @h0r53 Although you *can* install 64-bit in `Program Files (x86)`, that is besides the point (i.e. irrelevant to the question), because the JRE in the `C:\Program Files (x86)\Java\jre1.8.0_291` folder is actually a 32-bit version of the JRE. – Andreas Jul 20 '21 at 15:40
  • @Andreas, so I don't have *duplicate* but i have both 64-bit and 32-bit right? and do i need that different build in `Program Files (x86)`? – Roo Tenshi Jul 20 '21 at 15:48
  • @h0r53 , the `PATH` environment variable only includes `C:\Program Files\Java\jdk-16.0.1\bin` and `JAVA-HOME` is also set to `C:\Program Files\Java\jdk-16.0.1` – Roo Tenshi Jul 20 '21 at 15:50
  • Can you please check the **updated** question? – Roo Tenshi Jul 20 '21 at 20:14

1 Answers1

1

"If you want to run Java programs, but not develop them, download the JRE. If you want to develop Java applications, download the Java Development Kit, or JDK. The JDK includes the JRE, so you do not have to download both separately."

reference: JDK 7 and JRE 7 Installation Guide https://docs.oracle.com