How to Build Java Applications Today: April 19, 2021
Tags: java, bpf
Published: 2021-04-19 21:50:54

## TLDR
I’m a JJUG CCC Spring speaker, Oracle’s Java architect panel, IBM joins Eclipse Adoptium, Java AOT compilation beyond GraalVM, down to 4 smartphone vendors, and Spring Spring Boot 2.3.10 & 2.4.5.

***

## README
This is **issue 32** of my weekly newsletter, “How To Build Java Applications Today”. I read all the Java newsletters, so **you** don’t have to! And I try to entertain you while presenting the news.

If you like my newsletter, then [subscribe to it on Substack](https://bpfnl.substack.com)!

***

## Quote of the Week
*We have two lives, and the second begins when we realize we only have one.‌*
[Confucius](https://www.goodreads.com/quotes/950577-we-have-two-lives-and-the-second-begins-when-we), Chinese philosopher ([551–479 BCE](https://en.wikipedia.org/wiki/Confucius))

***

## Stand-Up
What can I say: Another Java conference picked up my talk “How Should Java Developers Build Front-Ends for Web, Mobile & Desktop Today”. This time, it’s the Japan Java User Group with their [spring conference](https://betterprojectsfaster.com/learn/talks-jjug-spring-2021-how-to-build-front-ends/). The schedule isn’t out yet, but I hope the time difference won’t be mean to me!

My second InfoQ news article [got published](https://www.infoq.com/news/2021/04/jhipster-java-app-generator/). It’s a topic that I [know well](https://betterprojectsfaster.com/learn/#tutorial-jhipster): JHipster 7.0. I’m working on my third article already.

***

## Code Review
### Issue 31 from April 12, 2021
[Last week’s issue](https://bpfnl.substack.com/p/how-to-build-java-applications-today-894) had some embarrassing mistakes: The version sent by mail had the wrong date in the title and a typo in the summary. That’s what happens when you start writing a newsletter too late in the evening. Or when you don’t have an editor. Or both. 

Anyhow, I hope this week’s issue turns out better. At least, I started writing earlier this time around!

***

## Bookmarks
### Java
#### How Do Oracle’s Java Architects Want to Combat Java’s Slide in Popularity?
In the TIOBE Index for April 2021, Java lost a third of its popularity year-over-year, barely clinging to second place ahead of surging Python (see [issue 30 from April 5](https://bpfnl.substack.com/p/how-to-build-java-applications-today-b67), section “TIOBE Index April 2021”). In the quarterly “RedMonk Programming Language Rankings”, Java’s in third place already, behind JavaScript and Python. It dropped to that place [in Q2/2020](https://redmonk.com/sogrady/2020/07/27/language-rankings-6-20/) (see [issue 26 from March 8](https://bpfnl.substack.com/p/how-to-build-java-applications-today-6ed), section “RedMonk Programming Language Rankings Q1/2021”).

Oracle recently got its Java Architects together for a [panel discussion](https://youtu.be/CVE4bWvuD3o): Mark Reinhold (Chief Architect), Brian Goetz (Chief Language Architect), Mikael Vidstedt (Group Director Software Development), and Ron Pressler (Consulting Member of Technical Staff). So, what did they have to say about that slide in popularity? Unfortunately, not much. And their plan won’t move the needle anytime soon.

Mark Reinhold isn’t much help here. He puts up a so-called “[straw man](https://en.wikipedia.org/wiki/Straw_man)”: A false argument that’s easier to beat than your opponent’s real argument. Mark says that the popularity of languages is measured by downloads and that he doesn’t believe in these statistics ([time-coded YouTube link](https://youtu.be/CVE4bWvuD3o?t=711)). Mr Reinhold, happy to correct you: It’s [search engine queries](https://www.tiobe.com/tiobe-index/programming-languages-definition/) for TIOBE, questions on Stack Overflow and pull requests on Github for RedMonk. And then Mark says he likes developer surveys more. Fair enough. But then he doesn’t cite any that put Java up against other languages.

Fortunately, Ron Pressler is more helpful ([time-coded YouTube link](https://youtu.be/CVE4bWvuD3o?t=711)): He wants Java to stay in the top 3 or 4. Well, that’s a word. He thinks that the upcoming changes in Java, like Project Loom and Project Valhalla, will help, but more is needed.

Here’s the problem: It could be five years before these “upcoming changes in Java” make a dent in TIOBE or RedMonk. Why’s that?

To change Java slide in popularity, developers first need to experience changes for the better in Java. Then they need to use Java more. And finally, TIOBE and RedMonk need to pick up on these changes in Java adoption. That’s two years right there.

But most of us Java developers **won’t** see these “changes for the better” in Java for years to come. Heck, most of us are still on Java 8: JRebel says it’s 69% ([issue 27 from March 15](https://bpfnl.substack.com/p/how-to-build-java-applications-today-4b3), section “JRebel 2021 Java Technology Report”), Snyk pegged it at 64% [way back in February 2020](https://snyk.io/blog/jvm-ecosystem-report-2020/) (the 2021 report [isn’t done yet](https://snyk.io/blog/java-ecosystem-survey-2021/)). And the adoption of Java 12-16 remains limited.

And these changes that Oracle talks about? They [won’t be in Java 17](https://www.infoworld.com/article/3606833/jdk-17-whats-in-store-for-java-17.html). So even if developers move off of Java 8, most will only get these changes with Java 23 in 2024. That’s the next LTS release after Java 17, the upcoming LTS release this September. When we add the two years from above for Java 23 changes to ripple through the Java ecosystem, we’re talking late 2026 for seeing results in TIOBE and RedMonk. That’s a long time for Java to slide! Let’s hope Java’s still in the top 4 by then. 😓

[YouTube video](https://youtu.be/CVE4bWvuD3o)

***

#### IBM Joins Eclipse Adoptium To Publish OpenJ9 Binaries
[AdoptOpenJDK](https://adoptopenjdk.net) distributes JDK binaries for the Oracle Hotspot JVM and the Eclipse OpenJ9 JVM. [OpenJ9](https://www.eclipse.org/openj9/) originated with IBM but was open-sourced to the Eclipse foundation four years ago.

When AdoptOpenJDK moved to Eclipse to become Adoptium (see [issue 29 from March 29](https://bpfnl.substack.com/p/how-to-build-java-applications-today-3af), section “AdoptOpenJDK Gets Eclipse Working Group and Access to TCK”), they accepted Oracle’s terms that [forbade them to ship OpenJ9 binaries](https://www.eclipse.org/lists/openj9-dev/msg00086.html).

Let me get this straight: A non-Eclipse project moves to Eclipse and can’t ship binaries for another Eclipse project anymore. Isn’t it ironic, [don’t you think](https://youtu.be/Jne9t8sHpUc)? 

So, where does one get OpenJ9 binaries in the future?

IBM wouldn’t be IBM if it didn’t know a way out of this conundrum: Money. IBM just joined Eclipse Adoptium as an enterprise member and can now offer “free certified JDKs with Eclipse OpenJ9”. Problem solved!

[Announcement blog post](https://developer.ibm.com/blogs/ibm-joins-eclipse-adoptium-and-offers-free-certified-jdks-with-eclipse-openj9/)

***

#### Java Ahead-of-Time Compilation Beyond GraalVM?
Unless you’ve lived under a rock for the last year or two, you’ve probably heard of [GraalVM](https://www.graalvm.org/). Using so-called Ahead-of-Time Compilation (AOT), it produces native images for our Java programs that use much less memory and start much faster. Spring Boot will support this out of the box this fall (see [issue 28 from March 22](https://bpfnl.substack.com/p/how-to-build-java-applications-today-762), section “Kicking Spring Native's Tires”). And the competitors of Spring Boot, like [Quarkus](https://quarkus.io) and [Micronaut](https://micronaut.io), have long supported GraalVM.

Are there other AOT options beyond GraalVM? Yes, but we’re best served by GraalVM. Still, what are those options?

First up is [Project Leyden](https://www.infoq.com/news/2020/05/java-leyden/), an OpenJDK initiative. It wants to standardize what GraalVM does: Fix the “slow start-up time, the slow time to peak performance, and the large footprint of Java applications”. How? When? With whom? We don’t know: The expert group working on Project Leyden hasn’t formed yet. Is this another “Java module system” - an unnecessary recreation of an existing, good-enough solution? Only time will tell.

[Checkpoint Restore in User Space](https://en.wikipedia.org/wiki/CRIU) (CRIU) is here today. It allows us to save a snapshot of a running Linux process and restore it later. That takes care of Java’s slow start-up time but doesn’t fix the memory footprint or the time to peak performance.

Finally, the presenter counts frameworks like Quarkus or Micronaut as another set of options. But they use GraalVM under the hood, so to me, they don’t count.

[InfoQ presentation](https://www.infoq.com/presentations/java-start-fast-graal-substrate/)

***

### Over The Fence
#### We’re Down To Four Smartphone Vendors
Smartphones are the most used computer to consumers everywhere and become increasingly important in the enterprise. So it’s a good thing that there are so many vendors to choose from. Right. Right?

Wrong: There are only four important smartphone vendors left. Who are they?

You probably guessed Apple and Samsung. Then there’s the popular Chinese brand Xiaomi. And finally, we have BBK. BB what? Yeah, I hadn’t heard of them either. It’s a Chinese company that owns Vivo, Oppo, RealMe, and OnePlus. Ok, but where’s everybody else?

LG just [recently quit](https://www.theverge.com/2021/4/4/22346084/lg-exits-smartphone-business). Sony [could be next](https://www.xda-developers.com/sony-smartphone-business-future-discussion/). And the Chinese vendor Huawei is hit hard by US sanctions and already [sold off its secondary phone business](https://www.gsmarena.com/huawei_officially_announces_its_sale_of_honor_will_hold_no_share_following_the_sale-news-46302.php). 

We’re at least better off with four vendors than in the early 2000s: Just three vendors dominated phone sales back then. Which ones? Read the article to find out! A hint: In a sign of European technology decline, two of the three were from Europe. Scandinavia, to be more precise. Well, now I made it too easy, I think!

[News article](https://digitstodollars.com/2021/04/07/the-handset-industry-is-a-flat-circle/)

***

### Releases
#### Spring Boot 2.3.10 & 2.4.5
To all of you Spring Boot developers out there: It’s time to upgrade! Spring Boot 2.4.5 has [57 bug fixes, documentation improvements, and dependency upgrades](https://github.com/spring-projects/spring-boot/releases/tag/v2.4.5), Spring Boot 2.3.10 [has 78](https://github.com/spring-projects/spring-boot/releases/tag/v2.3.10.RELEASE).

[Announcement 2.3.10](https://spring.io/blog/2021/04/15/spring-boot-2-3-10-is-now-available), [announcement 2.4.5](https://spring.io/blog/2021/04/15/spring-boot-2-4-5-available-now)
***

## About
Karsten Silz is the author of this newsletter. He is a full-stack web & mobile developer with 22 years of Java experience, author, speaker, and entrepreneur. Karsten got a Master's degree in Computer Science at the Dresden University of Technology (Germany) in 1996.

Karsten has developed software in five European countries and the US. In 2004, he co-founded a software product start-up in the US. During power outages, the software protected TV, Internet, and phone services for 50 million North American cable TV households. Karsten led product development for 13 years and left after the company was sold successfully.  

Karsten has worked as a contractor since 2017. He co-founded the UK SaaS start-up "[Your Home in Good Hands](https://yourhomeingoodhands.co.uk/)" as CTO in 2020.

Karsten has [this newsletter](https://bpfnl.substack.com/), a [developer website](https://betterprojectsfaster.com/), and a [contractor site](https://ksilz.com/). He's on [LinkedIn](https://www.linkedin.com/in/ksilz/), [Twitter](https://twitter.com/karsilz), and [GitHub](https://github.com/ksilz).