Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Key takeaways on upgrading to Java 12

1 min read

upgrade

This month we are focusing on Java 12 new features you should know about. In other articles, we looked at improvements to Garbage Collection, Java 12’s JVM Constants API explained in 5 minutes, Java 12 made microbenchmarking easier and Java 12 Switch Expressions explained in 5 minutes

In this article, we look at an overview of the main changes.

Java 12 is the March 2019 release of Java. It is a short-term release so will be superseded by a new Java in September. In this article, I will focus on the changes between Java 11 and Java 12. If you are upgrading from an earlier version of Java, I recommend you read our blog posts on Java 8, Java 9 and Java 10. So what issues will you find in upgrading from Java 11 to Java 12?

With any new release, there are new features and things which have changed…. So What is new?

There is only one new language change in Java 12, which is JEP 325: Switch Expressions. This makes the switch statement more flexible and is a ‘nice to have’ but not a major language change. We will be sticking to Java 8/Java 11 as the two versions of Java we use.

There are bigger changes are in the way Java is being developed with Microbenchmarks for the JDK (JEP:230), and a single Java version for 64bit ARM systems (JEP:340).

The way Java runs has changed. So, there are now better startup times on 64 bit systems thanks to JEP:341.

Garbage-collection in Java 12 is significantly improved with more options to fit different use cases. There are improvements to the traditional G1 Garbage collector and and a new Garbage collector called Shenandoah for users who want to have a low pause time – ie prioritise responsiveness on their systems. We have a detailed summary of the options in our post Changes to Garbage Collection in Java 12.

When we tested Java 12 on our systems, we also found that Maven would no longer accept a code base setting of Java 6 (you now need to be on Java 8). So if you are writing legacy code, you will need to stay on Java 11 or earlier.

In summary, Java 12 is probably not going to change the way you write Java, but it does simplify the development of the Java platform and offers some exciting options for optimisations with Garbage collection if you can run your code on the Java 12 JVM. You may well want to stay on Java 11 code level but start to run your code on there latest JVM to enjoy these benefits…

IDRsolutions develop a Java PDF Viewer and SDK, an Adobe forms to HTML5 forms converter, a PDF to HTML5 converter and a Java ImageIO replacement. On the blog our team post anything interesting they learn about.

Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2019. All rights reserved.