11 December 2018
So you want to upgrade to Java 11?
Maybe you’ve put off upgrading Java for a while but are realizing that Oracle soon plans to stop supporting Java 8. Have no fear, since you’ve procrastinated, other people have gone through the pain already and shared what they learned!
First of all, what’s new in Java 9, 10, and 11? The big things are JShell, modularity, local variable declarations (var), and in 11 the removal of JavaEE, xml, and corba among other things. Davide Angelocola shared a good summary of the new features, as well as his notes on upgrading to Java 11 here in this tweet (pdf).
In another post by Giacomo Veneri gives a good overview of features from 8 to 11 including creating immutable collections, new String methods, and more and comes with a handy chart. image
Finally, Benjamin Winterberg gives a great overview of how to upgrade to Java 11 with Maven. The main takeaway is to update all your dependencies and add any missing libraries like jaxb and javax.annotations.
Due to Oracle’s change in licensing it is highly recommended you use OpenJDK in production now (it’s mostly identical to Oracle Java and Oracle now charges for Oracle JDK in production). Other editions of Java exist or will exist in the future such as Amazon Coretto due to the changes.