1

If using features from Java SE 12, 13 and now 14, how do I know if the end user JRE is capable of running it? Since Java 8 the official Java download page only have something called "Java Version 8"

https://www.java.com/en/download/

How does this match with the higher versions when downloading JDKs?

Answer: Version 8 must be taken literally. Oracle latest JRE cannot run Java 9+ kode! You have to download the JDK (yikes!) or user jlink to bundle JRE with you software

Stig
  • 1,290
  • 1
  • 13
  • 41
  • 1
    Does this answer your question? [How to find the JVM version from a program?](https://stackoverflow.com/questions/5103121/how-to-find-the-jvm-version-from-a-program) and Java is compatible downwards until Oracle will tell us something different. – Reporter Mar 18 '20 at 12:13
  • Java is backwards compatible, you can run old code on new JREs. But an old JRE may not run code compiled with newer JDKs. – Stig Mar 18 '20 at 12:26
  • that is also why you have the "compiler compliance level". Read here https://stackoverflow.com/questions/22584427/what-is-compiler-compliance-level-in-eclipse – Stig Mar 18 '20 at 12:29
  • and for the question, this is not about finding JVM version from code. I want to know which JRE version (if they still call it JRE) to download to be sure e.g. Java 14 compiled code will work. – Stig Mar 18 '20 at 12:37
  • 1
    I think that the answer is none will. Oracle stopped shipping JRE distros with Java 8. To run code compiled for Java 9 or later on an Oracle JVM, you must use an Oracle JDK distro. – Stephen C Mar 18 '20 at 12:39
  • See https://stackoverflow.com/questions/55868821/when-jre-was-completely-discontinued-as-a-separate-offering and https://stackoverflow.com/questions/53111921/how-to-get-java-11-run-time-environment-working-since-there-is-no-more-jre-11-fo/53112096 – Stephen C Mar 18 '20 at 12:41
  • Wow that is what i feared. So if I use all the new Java features I cannot guide an end user to the official Java download page? Can anyone confirm this? – Stig Mar 18 '20 at 12:42
  • That is correct. Either guide them to the official page to download an Oracle JDK ... or use jlink to make executables with embedded JREs. Or guide them to somewhere to download a 3rd-party JRE distro! – Stephen C Mar 18 '20 at 12:44

0 Answers0