days
0
-8
hours
-2
-3
minutes
-4
0
seconds
-1
-5
search
Mini-series: Part 1

Manual on Java 11: Java experts share their best & worst experiences with Java 11

Gabriela Motroc
Java 11
© Shutterstock / Roobcio

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.

Java 10 marked the beginning of a new era in the Java ecosystem but the latest release proves there are still some milestones to smash; Java 11 the first LTS release in Oracle’s new six-month cycle.

You can download Java 11 here.

Java 11 delivers 17 enhancements, including

  1. JEP 321 – HTTP Client (Standard), which standardizes the incubated HTTP Client API introduced in JDK 9 [via JEP 110], and updated in JDK 10.
  2. JEP 332 – Transport Layer Security (TLS) 1.3 is a major overhaul of the TLS protocol and provides significant security and performance improvements over previous versions.
  3. JEP 328 – Java Flight Recorder (JFR) provides a high-performance flight recording engine and low-overhead data collection framework for troubleshooting mission-critical Java applications.
  4. JEP 333 – Project ZGC can handle heaps ranging from relatively small to very large in size.
  5. JEP 330 – Launch Single-File Source-Code Programs simplifies the “on-ramp” or new Java users by enhancing the java launcher to run a program supplied as a single file of Java source code, including usage from within a script and/or related techniques.

Read more about the highlights here. If you’d like to learn more about Java 11, check out the release notes.

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.

We invited eight Java experts to share their best & worst experiences with Java 11. 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.

Our interviewees will share the following:

  • First impression of the new release

  • Tips & trips for “navigating” JDK 11

  • Cleverest hack discovered so far

  • How much they care about JDK 11

8 answers:  What are your best & worst experiences with Java 11?

Meet the experts

Mala Gupta (@eMalaGupta) is the founder of eJavaGuru.com. She is a Java Champion, book author, speaker, and co-leader of DelhiJUG.

Josh Long (@starbuxman) is the Spring Developer Advocate at Pivotal. He is the author of 5 books and 3 best-selling video trainings. He is also a Java Champion.

Lukas Eder (@lukaseder) is the founder and head of R&D at Data Geekery GmbH, the company behind jOOQ and a Java Champion.

Matthew Gillard (@MaximumGilliard) works for Oracle in Bristol (UK) on Open-Source, Java and Serverless/Cloud infrastructure.

Marcus Biel (@MarcusBiel ) is a speaker, author, JCP member, and Java Clean Code Evangelist.

Trisha Gee (@trisha_gee ) is a Developer Advocate at JetBrains, a key member of the London Java Community and a Java Champion.

Simon Ritter (@speakjava ) is the Deputy CTO of Azul Systems.

Tal Weiss (@weisstal) is the CTO and co-founder of OverOps.

tl;dr

Pros

+ 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

Cons

– 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

 

Mala Gupta: Using HTTP Client to work with non-blocking asynchronous code and using annotations with local variables for lambda parameters were one of the best experience using JDK11. Experimenting with different combination of configuration values with Epsilon, a no-op GC, was super exciting. It was also challenging to replicate the values.

New Java learners (in one of my workshop), were confused with launching single source code programs without compilation. The launch didn’t work if they compiled the code by mistake or moved to multiple source code files.

Josh Long: This release has very little for me as a programmer – that is, very little has changed for me in my day to day experience writing code. Sure, being able to prefix lambda parameters with `var` just like I can already redundantly prefix them with their type is kind of nice. But, I’ve not yet needed it. I think the biggest change, as a programmer, is the new standardized reactive HTTP library. But, of course, there are already good reactive HTTP libraries in the ecosystem so this shouldn’t be seen as the main reason to upgrade.

I also like that this is an LTS release, to remove the last roadblocks for those customers hesitant to move beyond Java 8.

Those are nice features, to be sure, but not candy – nothing that’ll make my code markedly easier to read and nothing that fills a gap I can’t otherwise fill. Java 11 has a few nice goodies from the security perspective. I think the really quick turnaround integration of TLS 1.3 is amazing. TLS 1.3 was finalized in March of 2018!

The new support for ChaCha20 and Poly1305 cryptographic algorithms is a welcome addition. Good job, Java team!

I don’t really see any downsides for me, in my enterprise Java-centric world, but there are some possible inconveniences for those users depending on the deprecated bits in this release including the Nashorn JavaScript engine, the CORBA modules, the Pack200 Tools and API, and so on. I also like that this is an LTE release, to remove the last roadblocks for those customers hesitant to move beyond Java 8.

Lukas Eder: After the initial trouble adding JAXB as an optional dependency for JDK 9 & 10 support, things have gotten even hairier now that JAXB has been removed from the JDK in JDK 11. While it isn’t too difficult to get dependencies right, it does cause our jOOQ users some extra trouble to configure when setting up jOOQ for the first time.

Luckily (for jOOQ), we’re not the only library that causes these problems to their users, so it doesn’t look like it’s our fault. I’m still working on the correct Maven dependency declaration for jOOQ that works on all of JDK 6 – 11.

Don’t get me wrong though. I really think JAXB shouldn’t be part of the JDK and its removal is a good thing (just like CORBA’s removal).

SEE ALSO: Poll results: It’s one big leap forward towards Java 11

Matthew Gillard: 

Best experience – Better startup performance than Java 9 and 10

Worst experience –  Startup is still comparable to Java 8

Marcus Biel: First port of call is certainly the OpenJDK project page, where the 17 JEPs of the Java 11 release are listed. At first glance, Java 11 seems to offer mainly changes “under the hood” and no real developer features. However, this isn’t the case.

The String API enhancements (repeat, isBlank, strip, lines) for example, I think are pretty cool. For me, it’s often the little things that make our lives as developers easier. Up until now, we’ve had to access an external library like commons-lang for such simple things like “isBlank” – great that we can save that in the future!

Last, but not least, I think it’s always good when obsolete features are thrown overboard – like the Java EE and CORBA modules or Java Web Start.

I think it’s always good when obsolete features are thrown overboard.

Trisha Gee: The best thing is that with the 6-month release cadence, each release is small. This means:

a) much easier to see what’s in it and

b) smaller impact when upgrading.

Simon Ritter: I don’t have a worst experience, using JDK 11 has been very positive so far.  Admittedly, I don’t use any of the modules removed from the core libraries (the java.se.ee aggregator module and its constituents), so my applications have just worked without any changes.  

The best experience for me would be using the launch single-file source-code programs (JEP 330). The shebang support finally makes it really easy to write a simple application and not have to go through several steps to get it to execute.  I also really like the small change to the Predicate interface that adds the not() static method. This aids code readability in a number of situations.

Tal Weiss: I think one of the best new features is the new standardized HTTP Client API, that’s been incubating since JDK 9. It’s undergone many changes in its implementation since JDK 9, through JDK 10, and it’s finally been standardized in JDK 11. My experience with the new API is great. It feels well written and efficient, and it’s good to finally have a standard HTTP client API in the runtime.

 

Now that we’ve revealed the pros and cons of Java 11, let’s focus on the other important facets of the new release. In the next parts, we will talk about the experts’ 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. 

asap

Author
Gabriela Motroc
Gabriela Motroc is editor of JAXenter.com and JAX Magazine. Before working at Software & Support Media Group, she studied International Communication Management at the Hague University of Applied Sciences.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of