DEV Community

Cover image for How to Build Java Applications Today #72
Karsten Silz
Karsten Silz

Posted on • Originally published at open.substack.com

How to Build Java Applications Today #72

TL;DR

Java had patch releases, we can now write command-line interfaces with Java, and this book will save IntelliJ users tons of time.


README

Welcome toΒ the February 2023 issue of my newsletter β€œHow To Build Java Applications Today”! If you like it, then subscribe to it for free on Substack! Or read it on dev.to or Medium. Even better: Share it with people who are interested!


What's This?

In my monthly "Java Full-Stack Report", I recommend IDEs, build tools, JVM languages, databases, back-end frameworks, web frameworks, and mobile app frameworks. I also cover essential releases and news.

This report is different because it measures popularity by observing what all Java developers do: job ads from 59 countries, online training students, Stack Overflow questions, and Google searches. My recommendations are based on that popularity, industry analysis, and my 24 years of Java experience.

Why popularity? Because 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.


Stand-Up

I told you that I started a new Java contract on January 3. Two sprints in, I can share that I'm working with some technologies I haven't touched before. Namely Spring Boot 3, Kubernetes, MongoDB, and React. After many years, I also work with Maven again β€” and realize I still like Gradle a lot better.


My first conference talk of the year is at Germany's biggest Java conference, JavaLand. It's about when native Java with GraalVM is worth it. As it seems to have become a tradition, I first give my conference talk to the London Java Community (LJC). I was already booked for a regular online talk in early March when suddenly, a slot opened up at LJC Live on February 16. That's a monthly on-site event with two speakers. And I'm now one of them! This cuts my preparation time a bit short. But who says that deadline pressure is wrong?! πŸ˜… So if you're in London on February 16, I'd love to see you at LJC Live!


Last year, I talked about Google's Flutter at QCon London and then at QCon Plus. The QCon Plus talk was prerecorded. I edited it myself, so it's quite polished, if I may say so. 😏 And that talk is now public on InfoQ β€” as a video and text transcript. So if you want to know about Flutter, view or read for yourself!


Technology Index (Last Update: January 2023)

IDEs

  • Popularity trend: Eclipse is the most popular Java IDE and leads IntelliJ in job ads 2.5:1, though it has declined over many years in other categories. IntelliJ holds up well for a commercial product: It's only slightly behind Eclipse in Google searches and slightly ahead in questions at Stack Overflow. 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


Build Tools

  • Popularity trend: Maven is 2.5 times as popular as Gradle, except for Stack Overflow, where Gradle is slightly ahead. 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


JVM Languages

  • Popularity trend: Java is #1, Kotlin #2, and Scala #3. Java probably wins in job ad mentions where Scala also leads Kotlin. But Kotlin leads Scala in all other categories. Groovy and Clojure have mostly declined for many years. Python and JavaScript beat Java everywhere, but the job ad mentions rankings are unknown.
  • 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


Databases

  • Popularity trend: MySQL is #1, Postgres #2, and MongoDB is #3. After some turbulence, MySQL and MongoDB are back to their October 2021 values: MySQL leads Postgres 1.4:1, MongoDB has 70% of Postgres' numbers. Postgres and MongoDB are nearly at peak values at Stack Overflow.
  • 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


Back-End Frameworks

  • Popularity trend: Spring Boot dominates and still grows in all categories except for Google searches. Despite a long decline, Jakarta EE leads Quarkus in all categories but questions at Stack Overflow. Quarkus is now #3 in job ad mentions, Micronaut is the new #4.
  • 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


Web Frameworks

  • Popularity trend: React is #1, Angular #2, and Vue #3. React leads Angular by only 15% in job ad mentions but by 1.5-3.6 in the other categories. Vue has only 30% of Angular's job ad mentions but about 40-60% in the other categories.
  • 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


Mobile App Frameworks

  • Popularity trend: React Native dropped from a 2.9:1 lead over Flutter to a 1.9:1 since last April. Among developers, Flutter leads React Native 2:1 and pulls away (except for Google searches, where both slightly lost in 2022). 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 start a new project and have used React for building web applications, then use React Native.
  • If you start a new project and have .NET experience, then use .NET MAUI.
  • If you start a new project and need to use a library that's only available in Java, then use JavaFX.
  • Otherwise, start with Flutter first and use React Native if that doesn't work out for you.

Show Popularity & Details


Release Radar

Java had patch releases, while only Quarkus had a major release. Git, IntelliJ, VS Code, Spring Boot, Quarkus, Micronaut, and Helidon also had minor releases.

I added GraalVM to the list this month. We need it to build native Java applications.

Bold rows show major updates, italic rows signal minor ones.

Category Name & Download Version Date What's New Docs
Version Control Git 2.39.1 Jan 17, 2023 What's New, Release Notes Link
Build Tool Maven 3.8.7 Dec 24, 2022 Release Notes Link
Build Tool Gradle 7.6 Nov 25, 2022 Release Notes Link
IDE IntelliJ 2022.3.2 Jan 26, 2023 What's New Link
IDE Eclipse 2022-12 Dec 7, 2022 Video Link
IDE NetBeans 16 Nov 30, 2022 Release Notes Link
IDE VS Code 1.74.3 Jan 17, 2023 1.74.3 Link
Java Eclipse Temurin 19.0.2 Jan 26, 2023 Release Notes Link
Java Eclipse Temurin 17.0.6 Jan 24, 2023 Release Notes Link
Java Eclipse Temurin 11.0.18 Jan 26, 2023 Release Notes Link
Java Eclipse Temurin 8u362 Jan 26, 2023 Release Notes Link
Java GraalVM 22.3.1 Jan 24, 2023 Release Notes Link
Framework Spring Boot 3.0.2 Jan 20, 2023 Release Notes Link
Framework Spring Boot 2.7.8 Jan 19, 2023 Release Notes Link
Framework Spring Boot 2.6.14 Nov 24, 2022 Release Notes Link
Framework Quarkus 2.16 Jan 25, 2023 What's new Link
Framework Quarkus 2.15.2 Jan 4, 2023 Release notes Link
Framework Micronaut 3.8.3 Jan 28, 2023 3.8.3, 3.8.2, 3.8.1 Link
Framework Micronaut 3.7.5 Dec 20, 2022 Release Notes Link
Framework DropWizard 2.1.4 Oct 20, 2022 Release Notes Link
Framework DropWizard 2.0.34 Oct 18, 2022 Release Notes Link
Framework Helidon 3.1.0 Dec 21, 2022 Release Notes Link
Framework Helidon 2.5.6 Jan 20, 2023 2.5.6, 2.5.5 Link

New & Noteworthy

We Can Now Write Command-Line Interfaces with Java

Command-line interfaces (CLI) need to start quickly and not use much memory. Sot that ruled out writing them in Java for most of us: Sure, Maven and Gradle start fast. But they've been tuned for years and don't use the frameworks we want to use, like Spring Boot.

Until now, that is: Native Java with GraalVM makes it possible to write CLIs in Java!

just is an example of such a CLI. It doesn't matter to us that it's a Spring Boot tool. What matters is that it's a Spring Boot application starts in less than one second. On my M1 Max MacBook Pro, the application launches, displays the help screen, and quits again in 0.8 seconds:

% time just --help


       β–ˆβ–ˆβ•—β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
       β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β•šβ•β•β–ˆβ–ˆβ•”β•β•β•
       β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•‘
  β–ˆβ–ˆ   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
  β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
   β•šβ•β•β•β•β•  β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•   β•šβ•β•

Unknown option: '--help'
Usage: just [-V] [COMMAND]
  -V, --version   Print Just version
Commands:
  run     runs Spring Boot project - either with Maven or Gradle in dev mode
            with hot reloading enabled
  help    Display help information about the specified command.
  format  formats code with Spotless
  init    initializes Just related files
  build   builds application
  kill    kills process running on port
just --help  0.80s user 0.07s system 97% cpu 0.897 total
%
Enter fullscreen mode Exit fullscreen mode

So if you wanted to write a CLI in Java but didn't: Now's the time! Just pick a Java framework that supports native Java, like Spring Boot 3, Quarkus, or Micronaut. And build it as a native executable with GraalVM.

To the Quarkus and Micronaut fans among my readers: I know you guys could build fast CLIs for years. But I hope we can all agree that Spring Boot 3 made native Java more mainstream. πŸ˜€ Hence, this news item appears now.

Read the News


This Book Will Save IntelliJ Users Tons of Time

If you are an IntelliJ user, this book will save you a lot of time! Trisha Gee, the former lead developer advocate at JetBrains, and Helen Scott, the current lead developer advocate at JetBrains, wrote it together. Trisha covers the advanced users, while Helen dishes out tips for beginners.

So, how will this book make you faster? By focusing on three areas:

  • Keyboard First
  • Always Green
  • Staying in the Flow

The book is on Leanpub and costs 30 dollars. Saving dozens, if not hundreds of hours in the future, this book is a no-brainer for IntelliJ users!

Interested? Then read the interview with Trish & Helen.

Read the Interview


Better Debugging with Kotlin 1.8

I know, this is a Java newsletter. But what's wrong with occasionally looking at the other side of the fence and seeing if it's really greener? Which brings me to Kotlin 1.8, the latest release of the #2 language on the JVM. And this time, the grass is brown & muddy.

Why such harsh words? Well, let's look at the list of new features:

  • Better debugging by removing optimizations that mess with the debugging experience
  • Built-in function for recursively copying and deleting directories
  • Faster reflections
  • Support for writing Gradle tasks with Kotlin for Gradle 7.2 (released August 17, 2021) and 7.3 (released November 9, 2021).

Does this grass look green to you? And the support for Gradle 7.2 and 7.3 is especially baffling to me: What took so long? These releases are more than a year old! And how do I write Gradle tasks with Kotlin in the current Gradle release, 7.6?

Kotlin 1.8 has more changes, but they don't concern us Java developers (like improved interoperability with Apple's Objective-C & Swift).

Read the Announcement


Next Issue

The next issue will arrive on Wednesday, March 1, 2023. Subscribe to this newsletter on Substack for free to receive the next issue automatically!


About

Karsten Silz is the author of this newsletter. He is a full-stack Java developer (Spring Boot, Angular, Flutter) with 24 years of Java experience. Karsten has worked in Europe and the US and is also an author and speaker. He got a Master’s degree in Computer Science at the Dresden University of Technology (Germany) in 1996.

Karsten co-founded a software start-up in the US in 2004. He led product development for 13 years and left after the company was sold successfully. Karsten then co-founded the UK SaaS start-up "Your Home in Good Hands" as CTO in 2020. Since 2003, he has also worked as a contractor.

Karsten hasΒ this newsletter, aΒ developer website, and aΒ contractor site. He's onΒ LinkedIn,Β Twitter, Xing, andΒ GitHub. Karsten is also a Java editor at InfoQ.

Top comments (0)