How to Build Java Applications Today #68
Tags: java, bpf
Published: 2022-10-08 14:54:24

## TL;DR

Java 19 arrived, Java lost 20% of job ads recently, Quarkus & Micronaut now #3 & #4 in job ads, Spring Boot 3 ships in November & delays Java Module support, and Jakarta EE adds features for the first time in 5 years.

***

## README

Welcome to my newsletter “How To Build Java Applications Today”! If you like it, then [subscribe to it for free on Substack](https://bpfnl.substack.com)! Or read it on [dev.to](https://dev.to/ksilz/series/11995) or [Medium](https://ksilz.medium.com). Even better: Share it with people who are interested!

***

## Stand-Up

I did it again: For the second time in the history of this newsletter, an issue is late. Why did this issue go out three days later than planned? 

I just attended [JAX London](https://jaxlondon.com/) and gave two talks there ([here](https://betterprojectsfaster.com/learn/talks-jax-london-2022-talks-w-jax-2021-jhipster-pick-technologies-faster/) and [here](https://betterprojectsfaster.com/learn/talks-jax-london-2022-flutter-for-java-developers/)). So I planned to do most of the newsletter writing the week before the conference, but there my day job took priority. 😔

And then this is an issue where I do my quarterly popularity update. This takes a couple of days. I do collect data for the job and Udemy learners each month, but I only update the 38 charts once a quarter. This time, I also added a new data point ([market share of mobile frameworks in the installed base](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-10/fe-mobile/#installed-base)). And some of the existing charts saw improvements: The Google search charts now always have the current values above the chart and peak values below it, some of the Google search charts now go back three years instead of two, and some of the job ad charts now have all the data in one chart instead of two (like [the JVM language one](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-10/lang/#employers-job-ads)).

---

With JAX London behind me, I got one more conference ahead of me: [W-JAX Munich](https://jax.de/munich/). I'll talk about [Google's Flutter for Java developers](/learn/talks-w-jax-2022-flutter-for-java-developers/) on Nov 8 &mdash; again. Say hi if you see me there!

***

## Technology Index (Last Updated October 2022)
### Why Popularity - and How?

Picking a **popular technology** makes our developer life easier: easier to learn, easier to build, debug & deploy, easier to find jobs/hire, and easier to convince teammates & bosses. Now popularity can make a difference in two situations: When multiple technologies score similarly, we could go for the **most** popular one. And when a technology is very unpopular, we may **not** use it.

I measure popularity among employers and developers as the **trend** between competing technologies. I count mentions in job ads at Indeed for employer popularity. For developer popularity, I use Google searches, Udemy course buyers, and Stack Overflow questions.

**[Explain Popularity](https://betterprojectsfaster.com/guide/java-full-stack-index-popularity )**

***

### IDEs

- **Popularity trend:** Eclipse is the most popular Java IDE, though it has declined over many years. IntelliJ holds up well for a commercial product: Except for job ads, it's neck-to-neck with Eclipse. NetBeans is the least popular IDE. VS Code isn't a fully fledged Java IDE, but - apart from jobs - it's 3-4 times as popular as Eclipse & IntelliJ.
- If you **don't want** to spend money, then use **Eclipse**.
- If you **may** spend money, evaluate **IntelliJ**.
- Evaluate **VS Code** for non-Java work, like web development (I use it for all my websites).
- If you're using **NetBeans**, consider moving off of it.

**[Show Popularity & Details](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-10/ide)**

***

### Build Tools

- **Popularity trend:** Maven is 2.5 times as popular as Gradle, except for Stack Overflow, where Gradle is slightly ahead of Maven. Ant and sbt have declined for years.
- If you use Scala, then use **sbt**.
- Otherwise, if you absolutely cannot stand XML files and/or need to customize your build heavily, then use **Gradle**.
- Otherwise, use **Maven**.

**[Show Popularity & Details](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-10/build)**

***

### JVM Languages

- **Popularity trend:** Java is #1, Kotlin #2, and Scala #3. Java lost 20% of its job ad mentions over the last five months but still leads Scala and Kotlin and its non-JVM competitors like Python or JavaScript. Scala's recent lead in job ad mentions over Kotlin shrinks. Kotlin leads Scala in all other categories. Groovy and Clojure have mostly declined for many years.
- On your current project, **keep your existing language** unless that language is absolutely, really not working out for you.
- If you need to switch languages or are on a new project:
  - Use **Scala** if you need functional programming.
  - Use **Kotlin** if you really need a "more modern Java".
  - Otherwise, use the **latest Java LTS version** you, your team, and your application can take.

**[Show Popularity & Details](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-10/lang)**

***

### Databases

- **Popularity trend:** MySQL is #1, Postgres #2, and MongoDB is #3. MySQL and MongoDB surged over the last three months in job ad mentions, with MySQL leading Postgres now 2:1 and MongoDB reaching 70% of Postgres' numbers.
- On your current project, **keep your existing database** unless that database is absolutely, irrevocably, really not working out for you.
- If you need to switch databases or are on a new project:
  - If you know that you'll need the NoSQL features and/or scalability, and you can't get this with MySQL, then use **MongoDB**.
  - Otherwise, use **MySQL**.

**[Show Popularity & Details](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-10/db)**

***

### Back-End Frameworks

- **Popularity trend:** Spring Boot remains the framework to beat and still grows in most categories. Despite a long decline, Jakarta EE leads Quarkus in all categories but questions at Stack Overflow, where Quarkus hits its all-time high. Quarkus also placed number three in job ad mentions after DropWizard's collapse, while Micronaut is number four.
- On your current project, **keep your existing back-end framework** unless that framework is absolutely, really not working out for you.
- If you need to switch back-end frameworks or are on a new project:
  - Use **Quarkus** if you need the smallest possible, fastest-starting Java application **now**.
  - Otherwise, use **Spring Boot**.
  
**[Show Popularity & Details](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-10/be)**

***

### Web Frameworks

- **Popularity trend:** React is #1, Angular #2, and Vue #3. React leads Angular 1.4:1 in job ad mentions and pulls away from Angular in developer popularity. Vue holds steady in all categories at about half of Angular's level but catches up in job ad mentions and (more slowly) in students at Udemy.
- If you already use **React**, **Angular**, or **Vue** in your project, then keep using them. Otherwise, evaluate a migration. In many (most?) cases, such migration doesn't make business sense.
- If you start a new project or migrate, then start with **React** first, **Angular** otherwise, and finally **Vue**.
 
**[Show Popularity & Details](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-10/fe-web)**  

***

### Mobile App Frameworks

- **Popularity trend:** React Native has 50% more apps on iOS but only leads Flutter in job ad mentions 1.5:1 after a steep decline in the last five months. Among developers, Flutter leads React Native 2:1 and pulls away (except for Google searches, where both slightly lost). Xamarin and JavaFX have generally declined for years.
- **Don't** build two separate applications with Apple's and Google's **first-party** frameworks. Use a **cross-platform** framework instead.
- If you already use **Flutter** or **React Native** in your project, then keep using them. Otherwise, evaluate migration. In many (most?) cases, such a migration doesn't make business sense.
- If you start a new project or migrate and have used React before, then start with **React Native** first and use **Flutter** otherwise.
- If you start a new project or migrate and have **not** used React, then begin with **Flutter** first and use **React Native** otherwise.

**[Show Popularity & Details](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-10/fe-mobile)**

***

## New & Noteworthy

### What's New In Java 19

Java 19 landed on September 20 with 7 Java Enhancement Proposals (JEP). The two most exciting JEPs are about Project Loom &mdash; see the following news item.

Of the remaining five JEPs, the two about records have the broadest appeal. Here's a sample from [JEP 405](https://openjdk.org/jeps/405), which allows access to the record fields in an `instanceof`:

```
record Point(int x, int y) {}

static void printSum(Object o) {
  if (o instanceof Point(int x, int y)) {
    System.out.println(x+y);
  }
}
```

And here's a shortened example from [JEP 427](https://openjdk.org/jeps/427) about using records in a `switch` statement:

```
record Point(int i, int j) {}

static void typeTester(Object o) {
  switch (o) {
    case Point p -> System.out.println("Record class: " + p.toString());
    default      -> System.out.println("Something else");
  }
}
```

The other three JEPs are low-level features: a port to RISC-V and updates to the Foreign Function & Memory API and the Vector API.

**[Read the News Item](https://www.infoq.com/news/2022/09/java19-released)**  

***

### Virtual Threads from Project Loom Explained

Project Loom reinvents Java concurrency with a lightweight implementation of Java threads. They dramatically reduce the effort of writing, maintaining, and observing high-throughput concurrent applications so that a "thread-per-request" programming style becomes viable again. Virtual threads are supposed to be easy to troubleshoot, debug, and profile. 

So at least partially, Project Loom is on a collision course with reactive programming that has become popular recently (e.g., [Spring](https://spring.io/reactive), [Quarkus](https://quarkus.io/guides/getting-started-reactive), and [Helidon](https://helidon.io/docs/v3/#/about/introduction#_what_flavor_shall_i_use)). Or, in the words of Oracle's Java Language Architect Brian Goetz, "[Project Loom will kill reactive programming](https://bpfnl.substack.com/i/40094099/will-project-loom-kill-reactive-programming)".

We can use virtual threads easily in Java 19:

```
var executor = Executors.newVirtualThreadPerTaskExecutor();
executor.submit(() -> { // do something here };
```

**[Read the Article](https://www.infoq.com/articles/java-virtual-threads)**  

***

### Spring Boot 3 Ships November 2022 And Delays Java Module Support

We guessed that Spring Boot 3 (and Spring Framework 6) would ship by the time the [Spring One conference](https://springone.io/) starts (Dec 6–8, 2022). Now we know the planned release date for good: It's the end of November, as revealed by Spring Staff 2 Engineer Oliver Drotbohm in his [talk at JAX London](https://jaxlondon.com/java-core-jvm-languages/spring-boot-3-and-spring-framework-6-a-new-generation). You know, that JAX London where I gave two talks (about [Flutter](https://betterprojectsfaster.com/learn/talks-jax-london-2022-flutter-for-java-developers/) and [JHipster](https://betterprojectsfaster.com/learn/talks-jax-london-2022-jhipster-pick-technologies-faster/)).

And we also now know that Spring Boot 3 (and Spring Framework 6, on which it is based) won't support Java Modules. Maybe later it will. Why? Because VMware focuses on native Java with GraalVM. And because "there have been very few requests for it". Ouch...

**[Read My News Item](https://www.infoq.com/news/2022/10/spring-boot-3-jax-london)**  

***

### Jakarta EE 10 Adds New Features for the First Time in Five Years

After five years, Jakarta EE (formerly known as "Java Enterprise Edition" or "Java EE") has finally added new features. Yes, [Java EE 8 from August 2017](https://en.wikipedia.org/wiki/Jakarta_EE#History) was the last time they did: **Jakarta** EE 8 was a re-release in the Eclipse infrastructure, Jakarta EE 9 just moved to the `jakarta` namespace, and Jakarta EE 9.1 added compatibility for Java 11. So, what's new? Here are the highlights:

- Java 11 is the new baseline, but Java 17 is also supported.
- There's a new `@Asynchronous` annotation &mdash; - think `@Async` from Spring.
- Jakarta Persistence got "new functions to the Query Language and Criteria API". 
- Jakarta Security can now use [OpenID Connect](https://en.wikipedia.org/wiki/OpenID#OpenID_Connect_(OIDC)), which most social platforms use.
- REST services can now run outside of a Jakarta EE environment (e.g., in a unit test). Jakarta EE 10 also includes multipart from data.

**[Read the Article](https://www.infoq.com/news/2022/09/jakarta-ee-10-updates)**  

***

### My Short Interview with the Helidon Lead

Helidon 3.0 launched at the end of July. My news item about the launch was later. But I got to ask the Helidon project lead, Dmitry Kornilov, some questions. He thinks about 30% of all users choose the reactive programming model. You know, the one that Project Loom wants to kill (see item "Virtual Threads from Project Loom Explained" above). And Dmitry says Helidon has better dependency injection when running in native Java with GraalVM.

**[Read My News Item](https://www.infoq.com/news/2022/09/helidon-3-0)**  

***

## Release Radar

Java 11, 17, and 18 had patches in August. While Quarkus, Micronaut, NetBeans, and VS Code had major releases, Gradle, Git, Spring Boot, Helidon, and IntelliJ had minor ones.

**[Read the Release Radar](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-10/release-radar)**

***

## Next Issue: Wednesday, November 2, 2022

Thanks for reading this issue of “How to Build Java Applications Today“! [Subscribe to it on Substack for free](https://bpfnl.substack.com) to receive the next issue automatically! My newsletter is published on the first Wednesday of every month. 

***

## About

Karsten Silz is the author of this newsletter. He is a full-stack web & mobile developer (Spring Boot, Angular, Flutter) with 23 years of Java experience, author, speaker, and marathon runner. Karsten got a Master's degree in Computer Science at the Dresden University of Technology (Germany) in 1996.

Karsten has worked in Europe and the US. He co-founded a software start-up in the US in 2004. Karsten led product development for 13 years and left after the company was sold successfully. He co-founded the UK SaaS start-up "[Your Home in Good Hands](https://yourhomeingoodhands.co.uk/)" as CTO in 2020. Since 2019, Karsten also works as a contractor in the UK.

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), [Xing](https://www.xing.com/profile/Karsten_Silz/), and [GitHub](https://github.com/ksilz). Karsten is also a [Java editor at InfoQ](https://www.infoq.com/profile/Karsten-Silz).