47

UPDATE:

(to be more clear)

You can find JRE 8, JRE 9 and JRE 10 on Oracle's official website (click on each). But where is JRE 11?!

Also, JDK 11 doesn't include a JRE. I was expecting JRE to be installed with JDK.

Do final users of our apps need to install JDK?


ORIGINAL version of the question:

I downloaded and installed Oracle JDK 11 from its official site. I installed both ..._linux-x64_bin.rpm and ..._windows-x64_bin.exe (first on a Linux machine and second on a Windows machine). But I saw an unexpected thing! Where is JRE?

This is a snapshot of installation path on CentOS 7. As you can see there is no jre folder:

# ls /usr/java/jdk-11.0.1/
bin  conf  include  jmods  legal  lib  README.html  release

Same snapshot about Oracle JDK 8 (See jre folder specially):

# ls /usr/java/jdk1.8.0_191-amd64/
bin             lib          src.zip
COPYRIGHT       LICENSE      THIRDPARTYLICENSEREADME-JAVAFX.txt
include         man          THIRDPARTYLICENSEREADME.txt
javafx-src.zip  README.html
jre             release

Same snapshots on Windows machine:

> dir /b "C:\Program Files\Java\jdk-11.0.1" 
bin                                           
conf                                          
COPYRIGHT                                     
include                                       
jmods                                         
legal                                         
lib                                           
README.html                                   
release                                                                                     
           
> dir /b "C:\Program Files\Java\jdk1.8.0_181"  
bin                                           
COPYRIGHT                                     
include                                       
javafx-src.zip                                
jre                                           
lib                                           
LICENSE                                       
README.html                                   
release                                       
src.zip                                       
THIRDPARTYLICENSEREADME-JAVAFX.txt            
THIRDPARTYLICENSEREADME.txt 

On Windows machine, there are also two another differences between JDK 8 and JDK 11.

  1. A standalone JRE alongside JDK as you can see:

    > dir /b "C:\Program Files\Java"            
    jdk-11.0.1   
    jdk1.8.0_181 
    jre1.8.0_181 
    
  2. In path C:\Program Files (x86)\Common Files\Oracle\Java:

    > dir "C:\Program Files (x86)\Common Files\Oracle\Java"                                                                   
    ...                                                                                                                   
    ...                14 java.settings.cfg                                                                  
    ...    <JUNCTION>     javapath [C:\Program Files (x86)\Common Files\Oracle\Java\javapath_target_3015921] 
    ...    <DIR>          javapath_target_3015921 
    ...
    

    As you see javapath (that is in PATH environment variable) points to javapath_target_3015921. This folder contains 3 executables of JDK 8 (that aren't links!):

    > dir /b "C:\Program Files (x86)\Common Files\Oracle\Java\javapath" 
    java.exe                         
    javaw.exe                        
    javaws.exe 
    

Finally, I searched the web to find a standalone JRE and found out it doesn't exist!

Do final users of our programs need to install JDK?

Community
  • 1
  • 1
Mir-Ismaili
  • 8,113
  • 2
  • 52
  • 76
  • 9
    You might be further surprised to know that the Oracle JDK isn't free anymore except for development/testing purposes. Better switch to OpenJDK. – rustyx Dec 11 '18 at 22:37
  • @rustyx - Thanks for reminding this important note! – Mir-Ismaili Dec 11 '18 at 22:41
  • 1
    On the upside though OpenJDK does about everything OracleJDK does. If you can come up with things that you can't do with OpenJDK. I'd be interested. JavaFX was one of the things you needed OracleJDK before. Now it's completely seperate from any JDK/JRE and you bundle it with your program with a built tool like maven or gradle. – Max Dec 11 '18 at 22:46
  • There are at least 9 sources for obtaining an implementation of Java 11. Some are free-of-cost and some are not. See my flowchart diagram listing these sources on [my Answer](https://stackoverflow.com/a/54737381/642706) to the original of this duplicate Question. – Basil Bourque Feb 18 '19 at 01:11
  • 1
    Taking up @rustyx's helpful remark. The link to OpenJDK's JRE is [here](https://adoptopenjdk.net/releases.html) – questionto42 Nov 16 '20 at 15:51
  • I like getting my OpenJDK builds from [**ojdkbuild**](https://github.com/ojdkbuild/ojdkbuild/releases) project. And for development I'm using [**DCEVM**](http://dcevm.github.io/), which allows updating class definitions without a VM restart, so is like jrebel but free. – rustyx Nov 17 '20 at 13:10
  • 1
    Till which version Oracle JDK was allowed for commercial use? I thought from starting it is only allowed for development & teasting – P Satish Patro Apr 28 '21 at 06:09

1 Answers1

52

The whole structure with Java 11 has changed. Java is now a modular platform, where you can create your own "JRE" distribution with specifically the modules that you need to run your application.

The release notes at https://www.oracle.com/technetwork/java/javase/11-relnote-issues-5012449.html have the following sentence:

In this release, the JRE or Server JRE is no longer offered. Only the JDK is offered. Users can use jlink to create smaller custom runtimes.

Documentation about jlink: https://docs.oracle.com/en/java/javase/11/tools/jlink.html

And another article about it: https://medium.com/codefx-weekly/is-jlink-the-future-1d8cb45f6306

dunni
  • 38,210
  • 8
  • 94
  • 96