Manual on Java 11: Does Java 11 tick all the right boxes?
New Java release, new series! This time, we invited eight Java experts to share their best and worst experiences with Java 11, the hacks they discovered so far, their tips & tricks and more. By the time we’re done with all the parts of this series, it should look like a manual on Java 11.
To celebrate the release of Java 11, we invited eight Java experts to share their best & worst experiences with the latest version. Since this series is meant to be a manual on Java 11, our interviewees will also talk about their first impression of Java 11, the tips and tricks, the cleverest hacks and inevitably, if they really care about Java 11 -more than they cared about Java 8, at least.
But first, some context: Before Java 11 was released, we talked to eight Java influencers about the migration to the latest version and whether it’s a “worthy” migration milestone even if it doesn’t have “killer feature to drive adoption,” as Martin Thompson opined in the interview series. If you haven’t migrated yet, we thought you’d like to know the pros and cons of this new version.
Pros & cons of Java 11
+ using HTTP Client to work with non-blocking asynchronous code
+ using annotations with local variables for lambda parameters
+ the really quick turnaround integration of TLS 1.3
+ the new support for ChaCha20 and Poly1305 cryptographic algorithms
+ better startup performance than Java 9 and 10
+ String API enhancements (repeat, isBlank, strip, lines) are pretty cool
+ obsolete features are thrown overboard
+ smaller impact when upgrading
+ using the launch single-file source-code programs
+ the small change to the Predicate interface that adds the not() static method
– launching single source code programs without compilation is confusing
– has very little for programmers
– possible inconveniences for those users depending on the deprecated bits in this release
– JAXB has been removed from the JDK in JDK 11. It causes jOOQ users some extra trouble to configure when setting up jOOQ for the first time
– startup is still comparable to Java 8
Don’t miss the first part of our “Manual on Java 11” series:
Meet the experts
Learning curve for Java 11: Any surprises?
For developers, the learning curve for Java 11 is rather flat – I guess that’s a good thing for all of us, right? A moderate learning curve exists for implementers of frameworks or compilers, or people working on Java books and training courses.
– Marcus Biel
Not much, if you’re going from Java 10. A few things have been removed, which can lead to some surprises when compiling with it. The biggest learning curve would probably be if you moved from 8 straight to 11, as you’d have to understand everything about 9, 10, and 11.
– Trisha Gee
The learning curve for JDK 11 is very easy. JDK 11 does not contain a large number of developer-visible features, so there is not much to learn. The only language change is the extension of the use of var to Lambda parameters, and that is only relevant if you want to include an annotation. There are a few new APIs, which I have written all this up in a blog post, “90 New Features (and APIs) in JDK 11”.
– Simon Ritter
There’s almost no learning curve for JDK 11 compared to JDK 10 or 9, since the changes introduced in this release are rather incremental, in the form of small features and improvements to current features. There’s no change in paradigms or any new groundbreaking concepts to learn.
– Tal Weiss
8 answers: First impression of Java 11
Mala Gupta: The newer version is a treat for GC developers, VM developers and application performance architects.
Java is known for its highly configurable garbage collectors. With diverse and multiple garbage collectors like Epsilon and ZGC, JDK11 widens the horizons of the possibilities in garbage collection domain in Java – for creating newer garbage collectors and memory management models.
Interestingly, Epsilon is a no-operation garbage collector, which only allocates memory; doesn’t collect the garbage. When your application runs out of memory, the JVM shuts down. Though it might sound weird to have a garbage collector that doesn’t collect any garbage, think again. You can benchmark the memory efficiency and performance of your applications, by using Epsilon vs other garbage collectors. This enables you to choose the best GC for your application and also fine-tune your application.
With diverse and multiple garbage collectors like Epsilon and ZGC, JDK11 widens the horizons of the possibilities in garbage collection domain in Java
The Z Garbage Collector (ZGC) is a low latency GC. It aims to keep its GC pauses under 10ms (are you kidding me!).
JVM can run multiple languages like Kotlin, Scala, Clojure, Groovy and many others. It also runs on diverse platforms, from constrained IOT devices to enterprise servers. These factors have set new challenges for memory management and performance (Controlled latency, improved throughput). Possibilities are infinite. Let’s explore.
Josh Long: This is yet another solid release that, while being light on programmer candy, checks a lot of operational boxes for things like support, security, and control over memory.
Lukas Eder: It worked well, although most changes only affected the JDK or the JVM, not really the Java language, so from my personal perspective, not a lot of exciting things were changed.
I do think there are some very useful changes, though, which will enable cool features in the future, including:
- JEP 181: The current mismatch between the Java language and the runtime in terms of being able to access nested class members through synthetic access methods has always been a bit hairy, especially when working with reflection etc. It’s great to see this is being addressed.
- JEP 309: I do hope this will lead to the lazy initialization of static members in the future through some “lazy” keyword in the Java language. This would definitely help jOOQ’s generated code, which is a big bunch of static final references that have to be initialized in one go, at the moment.
- JEP 330: This looks not very useful for more seasoned developers, used to doing things in an IDE, but I’m sure it’s really helpful for new Java users, students, etc. Everything that helps getting started with Java more easily is good for the community.
Matthew Gillard: Firstly the 6-monthly release cadence seems to be going well, from a practical point of view. Working on a large software system with strict deadlines isn’t easy! But there are a lot of changes taking place such as end of public updates of Java 8, the new release cadence, and new channels for getting OpenJDK builds (including from Oracle!). Materials like the recent “Java is Still Free”* article by the Java Champions are really helpful, but the subject is complicated enough that there’s easy for people to misrepresent what’s happening which helps no one.
Secondly, there are some interesting features which will take some time to be adopted. For example, I think Flight Recorder (which isn’t really “new” but was previously an Oracle commercial JVM feature) will prove to be very significant and there’s an opportunity for tooling to give excellent insight into running JVMs.
Marcus Biel: I am probably most happy about JEP 318. I’ve been hoping for many years for a No-Op Garbage Collector that will allow us to do reliable performance testing.
It’s more interesting considering Java 9, 10 and 11 bundled together as a replacement for Java 8.
Trisha Gee: First impression is that there’s not that much in there that’s exciting for developers. I think it’s more interesting considering 9, 10 and 11 bundled together as a replacement for 8.
Simon Ritter: It is another solid release from the engineering team at Oracle. They have eliminated all priority one bugs so we can be confident of a stable platform. There’s not much for developers to get excited about but some of the internal features are laying the groundwork for more significant features like value types (project Valhalla), which will be delivered in the future.
SEE ALSO: Java 11 is here
Tal Weiss: I like the direction Java development has taken in the past few years, moving to bi-annual releases along with LTS releases. This aligns the Java release cycle with industry standards and ensures that releases aren’t too far apart both in terms of timing and in terms of feature-set, making it much easier to adopt new releases.
Now that we’ve revealed the pros and cons of Java 11, as well as the experts’ first impression of the latest release, let’s focus on the other important facets of the new release. In the next parts, experts will share their tips and tricks, the cleverest hacks and inevitably, if they really care about Java 11 -more than they cared about Java 8, at least.