How to Build Java Applications Today: April 12, 2021
Tags: java, bpf
Published: 2021-04-12 22:19:48

## TLDR
My VJUG talk video’s available, Microsoft announce OpenJDK distribution, how branches work in Git, IntelliJ 2021.1, Quarkus 1.13, and JDK Mission Control 8.

## README
This is **issue #31** 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 Java news here. A German developer trying to be funny - what can go wrong here?!

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

***

## Quote of the Week
*Nearly all men can stand adversity, but if you want to test a man's character, give him power.*
[Abraham Lincoln](http://www.quotationspage.com/quote/414.html), 16 US president ([1809-1865](https://en.wikipedia.org/wiki/Abraham_Lincoln))  

***

## Stand-Up
Last Wednesday, I gave my first talk at the [Virtual Java User Group (VJUG)](https://virtualjug.com/). Once more, the topic was “How Should Java Developers Build Front-Ends for Web, Mobile & Desktop Today”. At 50 minutes for the talk plus 8 minutes for questions & answers, it’s a bit on the long side. I need to cut out 5-10 minutes the next time.

Anyhow, my audience seemed to like it: On a scale from 1 (very bad) to 5 (very good), 9 people gave me a [combined score of 4.7](https://betterprojectsfaster.com/learn/talks-vjug-long-2021-how-to-build-front-ends/#feedback). So if you want to see the videos, the slides, additional information, and links for getting started, then head over to the [talk page](https://betterprojectsfaster.com/learn/talks-vjug-long-2021-how-to-build-front-ends)!

***

## Bookmarks
### Java
#### Microsoft Announces OpenJDK Distribution
Surprising exactly no one, Microsoft announced its own Java distribution last week. You can get [preview versions of Java 11 and Java 16 here](https://www.microsoft.com/openjdk). Microsoft’s distribution uses the build scripts and test suite of [Eclipse Adoptium](https://projects.eclipse.org/projects/adoptium) for its OpenJDK builds. “Adoptium” is the new name of the [leading OpenJDK distribution AdoptOpenJDK](https://snyk.io/blog/36-of-developers-switched-from-oracle-jdk-to-an-alternate-openjdk-distribution-over-the-last-year/).

Well, Mr. Smarty Pants, why was that sooo obvious then?

[Microsoft bought jClarity](https://jaxenter.com/adoptopenjdk-contributor-jclarity-acquired-microsoft-161112.html) in August 2019. That’s the company **behind** AdoptOpenJDK. And Microsoft hired people like the [JHipster project lead Julien Dubois](https://developer.microsoft.com/en-us/advocates/julien-dubois) to get more Java onto their Azure cloud platform. So [just like Amazon](https://aws.amazon.com/corretto/), Microsoft now has its own OpenJDK for its cloud platform. Google, when will you join the fray? 

And how’s Microsoft’s OpenJDK distribution different from AdoptOpenJDK and other OpenJDK builds? It isn’t - unless you’re on Azure: It may get some patches (e.g., for Azure or Windows) **before** they make their way officially into OpenJDK. And I’m sure Microsoft’s JDK plays nice with Windows.

[Microsoft’s Announcement](https://devblogs.microsoft.com/java/announcing-preview-of-microsoft-build-of-openjdk/)

***

### Tools
#### How Branches Work in Git
What’s the [Jeopardy](https://en.wikipedia.org/wiki/Jeopardy!)-style question for the answer “A pointer to the latest commit in a given context”? It’s “What is a Git branch?” So there you have it: A branch is a commit in Git. And switching branches means having a different HEAD commit. 

If you still want to know more details, then read on!

[Article](https://stackoverflow.blog/2021/04/05/a-look-under-the-hood-how-branches-work-in-git/)

***

### Releases
#### IntelliJ 2021.1

The most popular Java IDE (see “JRebel 2021 Java Technology Report” in [issue #27](https://bpfnl.substack.com/p/how-to-build-java-applications-today-4b3)) just got its first major release of 2021. So, what’s in it for us Java developers?

IntelliJ now has “basic support for Java 16”. Last month they said, [“IntelliJ IDEA 2021.1 supports all the new language features from Java 17”](https://blog.jetbrains.com/idea/2021/03/java-16-and-intellij-idea/). So what gives?! And JetBrains is really pushing its GitHub/Gitlab competitor [Space](https://www.jetbrains.com/space/) and its remote pair programming tool [Code With Me](https://www.jetbrains.com/code-with-me/) on us this time.

IntelliJ previews HTML files in the IDE (instead of launching a browser) and improves templates for Git pull requests and Git commits. With “Run Targets”, we can “run, test, profile, and debug our application in Docker containers or on remote machines”. That sounds cool - but how often do we really need to debug an application in production this way? And the profiler has a better UI and more measurements.

Shorter [announcement & video](https://blog.jetbrains.com/idea/2021/04/intellij-idea-2021-1/), longer [What’s New](https://www.jetbrains.com/idea/whatsnew/#whats-new-20211) 

***

#### Quarkus 1.13
Red Hat’s/IBM’s microservice framework Quarkus marches on relentlessly: [Version 1.23 is released](https://quarkus.io/blog/quarkus-1-13-0-final-released/) not even six weeks after [version 1.12](https://github.com/quarkusio/quarkus/releases/tag/1.12.0.Final) came out. Is that enough time for new features?

It certainly seems that way: When running tests, the so-called DevServices can start Docker containers to support our tests (e.g., with a database container). We can use tracing from the [OpenTelemetry](https://opentelemetry.io/) project (while “metrics and logging are still under development”). When running in Kubernetes, Quarkus can connect to some services [without additional configuration](https://github.com/k8s-service-bindings/spec#application-projection). Using web-sockets doesn’t require the [Undertow servlet container](https://undertow.io) anymore. And [Jacoco](https://www.eclemma.org/jacoco/) generates test coverage reports now.

If Quarkus’ disappointing market share of 6% (see “JRebel 2021 Java Technology Report” from [issue #27](https://bpfnl.substack.com/p/how-to-build-java-applications-today-4b3)) doesn’t increase, it won’t be because of a lack of releases!

[Announcement](https://quarkus.io/blog/quarkus-1-13-0-final-released/)

***

#### JDK Mission Control 8
Oracle tells us that with Java Flight Recorder (JFR), we can profile our Java applications in production - adding just 1% overhead (see “Profiling in Production?“ in [issue #25](https://bpfnl.substack.com/p/how-to-build-java-applications-today-b38)). If we do this, we need “JDK Mission Control” (JMC) to look at the results. And here we just got version 8.0, the same day that Java 16 was released.

It seems like a minor release: Flame graphs highlight where the CPU spends the most time. A treemap view makes it easier to spot which objects use the most memory. Thread graphs have more filters. And JMC can read JFR recordings with LZ4 compression.

It sure seems like profiling our Java applications is now easier than ever!

[Announcement](https://inside.java/2021/03/16/jmc-8-released/)

***

## About

Karsten Silz is the author of this newsletter. He has been a Java developer for 22 years.

Karsten grew up in East Germany, behind the Iron Curtain. He wrote his first BASIC program on a Sinclair Spectrum ZX81 in 1984 and never looked back. Karsten has a Master's degree in Computer Science from the Dresden University of Technology in 1996.

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

Since 2017, he has worked as a web & mobile full-stack Java contractor. He co-founded the SaaS start-up "[Your Home in Good Hands](https://yourhomeingoodhands.co.uk/)" as CTO in the UK 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).