Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What JRE to use for Java 14?

Tags:

java

java-14

There is a message

Project has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I googled "JRE required for JDK 14" and there is no download to be found. In my Java control panel on Windows 10, it says I have the latest version of the Java platform. I cannot downgrade the JDK on my project since I am using a library which was completely compiled on Java 14. How (and where) does one upgrade the JRE to match with Java 14 and support version 57?

like image 921
Thicc Avatar asked Apr 02 '20 03:04

Thicc


3 Answers

  • There is no seperate JRE for JDK 14.
  • You just need to install the JDK 14 and set the path in Environment Variables like, Variable name= JAVA_HOME & Variable value= C:\Program Files\Java\jdk-14.0.2\bin
  • To verify whether it was successful, close & reopen the command prompt and type java.
  • To check the Java version, type in command prompt javac -version . Should produce something like javac 14.0.2
like image 34
6 revs Avatar answered Sep 23 '22 12:09

6 revs


I assume you are using a Java version / build that is coming from Oracle on your machine. Since Java 11 the Oracle Java does not automatically update and install any new JRE on your system. Next to this Oracle does not provide JRE builds for Java 11+ anymore. You can only download JDKs from Oracle (Oracle JDK).

While Oracle provides an alternative with the Oracle JDK builds (see https://jdk.java.net/14/) you can not get a JRE here.

A very good alternative is AdoptOpenJDK that provides JREs for Java 14 here: https://adoptopenjdk.net/releases.html?variant=openjdk14&jvmVariant=hotspot

like image 155
Hendrik Ebbers Avatar answered Sep 21 '22 12:09

Hendrik Ebbers


Since Java 9 there is no JRE provided due to the platform modularization introduced through Project Jigsaw. If you want one, you should build it yourself using jlink with only those modules you really need.

If you just want to run your project you can use any JDK which supports Java 14.

like image 22
bish Avatar answered Sep 20 '22 12:09

bish