Java Versions and Features (JNNC Technologies Pvt.Ltd)

 



You can use this guide to get practical information on how to find and install the latest Java, understand the differences between Java distributions (AdoptOpenJdk, OpenJDK, OracleJDK etc.), as well as get an overview of Java language features, including version Java versions 8-14.

Practical Information

First, let’s have a look at some common, practical questions that people have when trying to choose the right Java version for their project.

Go to the AdoptOpenJDK site, chose the latest Java version, download and install it. Then come back to this guide to maybe still learn a thing or two about Java versions.

What is the latest Java version?

As of September 2020, Java 15 is the latest released Java version.

What Java version should I use?

Newer Java versions now follow every 6 months. Hence, Java 16 is scheduled for March 2021, Java 17 for September 2021 and so on. In the past, Java release cycles were much longer, up to 3-5 years. This graphic demonstrates that:

javaversions 3

With that many new versions coming out, there’s basically these real-world(™) usage scenarios:

  • Legacy projects in companies are often stuck with using Java 8 (see Why are companies still stuck with Java 8?) . Hence you will be forced to use Java 8 as well.

  • Some legacy projects are even stuck on Java 1.5 (released 2004) or 1.6 (released 2006) - sorry, pals!

  • If you are making sure to use the very latest IDEs, frameworks and build tools and starting a greenfield project, you can, without hesitation, use Java 11 (LTS) or even the latest Java 15.

  • There’s the special field of Android development, where the Java version is basically stuck at Java 7, with a specific set of Java 8 features available. Or you switch to using the Kotlin programming language.

Why are companies still stuck with Java 8?

There’s a mix of different reasons companies are still stuck with Java 8. To name a few:

  • Build tools (Maven, Gradle etc.) and some libraries initially had bugs with versions Java versions > 8 and needed updates. Even today, with e.g. Java >=9, certain build tools print out "reflective access"-warnings when building Java projects, which simply "feels not ready", even though the builds are fine.

  • Up until Java 8 you were pretty much using Oracle’s JDK builds and you did not have to care about licensing. Oracle changed the licensing scheme In 2019, though, which led the internet go crazy with a ton of articles saying "Java is not free anymore" - and a fair amount of confusion followed. This is however not really an issue, which you’ll learn about in the Java Distributions section of this guide.

  • Some companies have policies to only use LTS versions and rely on their OS vendors to provide them these builds, which takes time.

To sum up: you have a mix of practical issues (upgrading your tools, libraries, frameworks) and political issues.

Why are some Java versions, like 8 also called 1.8?

Java versions before 9 simply had a different naming scheme. So, Java 8 can also be called 1.8, Java 5 can be called 1.5 etc. When you issued the 'java -version' command, with these versions you got output like this:

c:\Program Files\Java\jdk1.8.0_191\bin>java -version
java version "1.8.0_191" (1)
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

Which simply means Java 8. With the switch to time-based releases with Java 9 the naming scheme also changed, and Java versions aren’t prefixed with 1.x anymore. Now the version number looks like this:

c:\Program Files\Java\jdk11\bin>java -version
openjdk version "11" 2018-09-25 (1)
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

Post a Comment

0 Comments

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();