I'm @MarcoBehler and I share everything I know about making awesome software through my guides, screencasts, talks and courses.

To verify you installed Java correctly, you can then simply run 'java -version'.

Java 9 brought the initial preview version of a new HttpClient.

Now, historically (pre-Java 8), there were actual source differences between OpenJDK builds and OracleJDK builds, where you could say that OracleJDK was 'better'.

, // state-based implementations of equals, hashCode, toString. Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.

With that many new versions coming out, there are basically these real-world usage scenarios: There’s a mix of different reasons companies are still stuck with Java 8. If you want to learn more about a specific version, go to the AdoptOpenJDK site, choose the latest Java version, download, and install it.

There’s a variety of sites offering Java (read: JDK) downloads and it is unclear "who offers what and with which licensing". With the Streams API, you can do the following: Obviously, I can only give a quick overview of each newly added Stream, Lambda or Optional method in Java 8 in the scope of this guide. So, Java 8 can also be called 1.8, Java 5 can be called 1.5 etc. Feels Javascript-y, doesn’t it?

This is just source code however, not a distributable build (think: your .zip file with the compiled java command for your specific operating system). Java versions before 9 simply had a different naming scheme. Check back soon.

Will be covered here, as soon as they are getting released. Ignore the Java-Docker images, .msi wrappers or platform-specific packages for the moment.

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

Historically, you downloaded just a JRE if you were only interested in running Java programs. Java 12 got a couple new features and clean-ups, but the only ones worth mentioning here are Unicode 11 support and a preview of the new switch expression, which you will see covered in the next section. In the past, Java release cycles were much longer, up to 3-5 years!. I'll send you an update when I publish new guides.

You will find a complete list of OpenJDK builds at the OpenJDK Wikipedia site. Newer Java versions now follow every 6 months. See the original article here. 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.

It obviously does not work the other way around, say your program relies on Java 14 features, that are simply not available under a Java 8 JVM.

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. You can use this guide to find and install the latest Java, understand the differences between Java distributions (AdoptOpenJdk, OpenJDK, OracleJDK, etc. 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.

Published at DZone with permission of Marco Behler. Optionals got the sorely missed ifPresentOrElse method. Now there’s one question left: Where do you get that Java .zip file from?

Copyright © 1993, 2018, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.All rights reserved.
To verify you installed Java correctly, you can then simply run  java -version.

That’s why in practice, there’s a handful of vendors that actually create these builds, get them certified (see TCK) and then distribute them. If you want a more detailed, thorough overview - including exercises - you can have a look at my Java 8 core features course. Java 9 got the Jigsaw Module System, which somewhat resembles the good old OSGI specification. The directory structure of JDKs also changed, with not having an explicit JRE folder anymore. It obviously does not work the other way around, say your program relies on Java 13 features that are simply not available under a Java 8 JVM. Java versions before 9 simply had a different naming scheme.

A JRE includes, among other things, the Java Virtual Machine (JVM) and the "java" command-line tool. Streams got a couple of additions, in the form of takeWhile,dropWhile,iterate methods.

This is just source code, however, not a distributable build (think: your .zip file with the compiled java command for your specific operating system).

Strings and files got a couple of new methods (not all listed here): Starting with Java 10, you can run Java source files without having to compile them first. ), as well as get an overview of Java language features, including version Java versions 8-14. Absolutely no spam, ever.

This is however not really an issue, which you’ll learn about in the Java Distributions section of this guide. CLI) utilities they deem useful. 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. The same goes for all other Java versions in between. A JDK includes everything the JRE has, as well as the compiler javac and a couple of other tools like javadoc (Java documentation generator) and jdb (Java Debugger). Unsubscribe anytime. Which brings us to the topic of distributions. But the only real change you as a developer will likely see is the introduction of the var keyword, also called local-variable type inference.

With Java 9, Java got its own, modern client - although in preview mode, which means subject to change in later Java versions. That’s why, in practice, there’s a handful of vendors that actually create these builds, get them certified (see TCK), and then distribute them. Some legacy projects are even stuck on Java 1.5 (released 2004) or 1.6 (released 2006) - sorry, pals! There are now record classes, which help alleviate the pain of writing a lot of boilerplate with Java. First, you need to differentiate between a JRE (Java Runtime Environment) and a JDK (Java Development Kit).

If the output looks like the one below, you are good to go. JVM Ecosystem Survey: Why Devs Aren't Switching to Java 11. OracleJDK, which is a branded, commercial build starting with the license change in 2019. But as of today, both versions are essentially the same, with minor differences.

Which means it can be used for free during development, but you need to pay Oracle if using it in production. And a couple of other improvements, like an improved try-with-resources statement or diamond operator extensions.

There’s two main feature sets I’d like to mention here: Before Java 8, whenever you wanted to instantiate, for example, a new Runnable, you had to write an anonymous inner class, like so: With lambdas, the same code looks like this: You also got method references, repeating annotations, default methods for interfaces, and a few other language features.

You can find a complete feature list here, but essentially, you are getting Unicode 12.1 support, as well as two new or improved preview features (subject to change in the future): Switch expressions can now return a value. A quick example: Now, pre-Java 8, you basically had to write for-loops to do something with that list.

Among them are Azul Zulu, Amazon Corretto as well as SapMachine, to name a few. Rafael Winterhalter compiled a great list of all available OpenJDK builds, including their OS, architecture, licensing, support and maintenance windows.