How to Build Java Applications Today: July 19, 2021
Tags: java, bpf
Published: 2021-07-19 21:58:44

---
canonical_url: https://bpfnl.substack.com/p/how-to-build-java-applications-today-67c
---
## TL;DR
JavaFX: 1 codebase for web, PC, and mobile, 9 tips for Oracle DB with JPA & Hibernate, JetBrains “State of Developer Ecosystem 2021”, Spring Framework 5.3.9 & 5.2.16, Quarkus 2.0.2, Hibernate ORM 5.3.21.Final, and Spring Data 2021.0.3 & 2020.0.11.

***

## README
This is **issue 45** of my weekly newsletter, “How To Build Java Applications Today”. I read all the Java newsletters, so **you** don’t have to! And it’s “Java news with a smile”.

If you like my newsletter, then [subscribe to it on Substack](https://bpfnl.substack.com)! Or read it on [dev.to](https://dev.to/ksilz/series/11995),  the [Java Cafe](https://thejavacafe.com/ksilz/series/1), or [Medium](https://ksilz.medium.com). Even better: Share it with people who may be interested.

***

## Quote of the Week
*Choose a job you love and you will never have to work a day of your life.*
[Confucius](https://www.quotespool.com/Author/Confucius), a Chinese philosopher ([551–479 BCE](https://en.wikipedia.org/wiki/Confucius)), hopefully describes most readers of my newsletter!

***

## Stand-Up
When I was a kid, I knew it was summer when it got warm, and the newspaper got thinner. I think the latter was because many journalists were on  vacation. But maybe they were ordered to write less to save paper or what-not. I lived in East Germany, after all!

Well, it’s summer again: It’s hot, and this issue is a bit thinner because, frankly, not a lot is happening in the Java world right now. How hot? We just got the first-ever “[extreme heat weather warning](https://www.bbc.co.uk/news/uk-57893385)” here in England because “temperatures would continue to climb and could reach 33C (91.4F)”. For my American readers, this temperature probably just qualifies as a “warm Spring day”. But it’s never been so hot over here. And like the rest of Europe, our homes typically don’t have air conditioning!

Talking about hot stuff: I’m looking for a contractor project in October this year! Please see the first-ever advertisement in this little newsletter of mine below.

***

## ADVERTISEMENT
### FULL-STACK JAVA FOR 22 YEARS
I’m a full-stack Java developer with 22 years of experience, looking for a project in October 2021, in Milton Keynes, London, or remote. I’ll work as a contractor or fixed-term employee but don’t take permanent positions. 

Interested? Then check out my resume & work samples!

[CHECK OUT MY RESUME & WORK SAMPLES ](https://ksilz.com/)

***

## Bookmarks
### Java
####  JetBrains “State of Developer Ecosystem 2021”
*The IntelliJ IDEA maker finds Java the third most popular language and the second most popular **main** one. Half of all Java developers plan to adopt/migrate to other languages. Java is most popular in the finance industry and Asia. Java 8 handily beats Java 11 in this report. And every second Kotlin developer already builds server-side applications.*

JRebel asked 876 Java developers for their “2021 Java Technology Report” (see [issue #27](https://bpfnl.substack.com/p/how-to-build-java-applications-today-4b3)). Snyk asked over 2,000 Java developers for their “JVM Ecosystems Report 2021” (see [issue #41](https://bpfnl.substack.com/p/how-to-build-java-applications-today-5ca)). But JetBrains, the maker of IntelliJ IDEA and other tools, blows those numbers away by asking nearly 32k developers and delivering roughly 10 times as much content! In a welcome move, they even documented the [methodology used in the report](https://www.jetbrains.com/lp/devecosystem-2021/methodology/).


So, what are the most relevant findings for us Java developers?

- JavaScript is the most popular language ahead of Python and Java, which lost ground last year (Java more than Python). No consolation for “Team JVM”: Kotlin and Scala also lost last year. Now Java is still the number 2 **main** programming language, but just 10% ahead of Python.
- Half of all Java developers plan to adopt/migrate to other languages: 13% of those want to move to Kotlin, 11% to Go, 8% to TypeScript and Python, 6% to Rust & Swift, 5% to JavaScript, and 17% to something else.
- Java is **most** popular in Asia: South Korea (53%), China (47%), and India (38%). Java is **least** popular in Europe: Russia (18%), Ukraine (20%), France (21%), and my country of residence, the United Kingdom (22%). 😒
- The finance industry remains a Java stronghold: 23% of all developers who use Kotlin as their main language develop for it, and 20% of all Java developers.
- Java 8 is the king of the hill at 72%, with Java 11% behind at 42%. Fortunately, Java 12 & newer with 30% soundly beat Java 7 & older with just 8%.
- Spring Boot & Spring MVC rule the web frameworks category with 65% and 42%. But Java/Jakarta EE is missing entirely from the results, so I think these numbers aren’t valid.
- Surprisingly, 52% of all Kotlin developers already use Kotlin for server-side development, though Android development is still more popular at 63%. Only 38% use Kotlin for migrating old projects, and 91% of all Kotlin developers used Java before.

There’s more information on other programming languages, technologies, and more in [this report](https://www.jetbrains.com/lp/devecosystem-2021/).  

[Announcement](https://blog.jetbrains.com/blog/2021/07/16/the-state-of-developer-ecosystem-2021), [report](https://www.jetbrains.com/lp/devecosystem-2021/)

***

#### JavaFX - One Codebase for Web, PC, and Mobile?
*Java-based UI framework JavaFX now runs on the web in beta. But too few people use it, so pick Google’s Flutter or Facebook’s React Native instead.*

[JavaFX](https://openjfx.io) is a Java-based UI framework that was first announced in 2007. Originally a Sun/Oracle project, the [company Gluon](https://gluonhq.com) is now the main driver.

We could already build UIs with JavaFX that run on the desktop and on mobile. Now Gluon [added web browsers to the mix](https://youtu.be/LoL30W0yo6g?t=830), using the low-level WebGL interface to “paint pixels”. 

One Codebase for web, PC, and mobile, written in Java - sounds brilliant! So what’s the catch?

Too few developers use JavaFX compared to Google’s Flutter, Facebook’s React Native, or Microsoft’s Xamarin. And important trends point downward: Google searches [have been down for 3 years](https://trends.google.com/trends/explore?date=2007-01-04%202021-07-19&q=%2Fg%2F11f03_rzbg,%2Fg%2F11h03gfxy9,%2Fm%2F02r0tn1,Xamarin), while [questions on Stack Overflow](https://insights.stackoverflow.com/trends?tags=flutter%2Cjavafx%2Creact-native%2Cxamarin) have been down for 2.5 years. JavaFX has only [153k students on Udemy](https://www.udemy.com/topic/javafx/): React Native has [more than 6 times as many](https://www.udemy.com/topic/react-native/) and Flutter [nearly 11 times as many](https://www.udemy.com/topic/google-flutter/). And for a [conference talk last May](https://betterprojectsfaster.com/learn/talks-jjug-spring-2021-how-to-build-front-ends), I [counted job offers](https://betterprojectsfaster.com/learn/talks-jjug-spring-2021-how-to-build-front-ends/#web-applications) in 61 countries that mentioned these technologies: Flutter was mentioned more than 7 times as often as JavaFX, and React Native nearly 15 times as often.

So what do we Java developers use instead of JavaFX? 

[I recommend](https://betterprojectsfaster.com/learn/talks-jjug-spring-2021-how-to-build-front-ends/#summary) Flutter - unless you already use React, then go for React Native.

Now Flutter uses the programming language Dart. Oh my, why can’t we just use Java? Fortunately, Dart **is** “simplified Java, tuned for building UIs”. Not convinced? Look at the Dart code below - it **nearly** compiles in Java. Next week I’ll tell you which part doesn’t!

```
class MyClass extends AnotherClass {
  String myString;
  int myInt;
  List<String> myList = new List<String>();
  
  String sayHello(String name) {
    var feedback = "Hello, " + name; return feedback;
  }
}
```

[Article](https://www.infoq.com/news/2021/07/javafx-web/)

***

### Frameworks & Libraries
#### 9 Tips for Oracle DB with JPA & Hibernate
Relational databases may not be our first choice for data stores these days. And in the age of open-source & microservices, a database that we have to pay for seems an unusual choice. 

But if we find ourselves in the situation of using Oracle DB through JPA/Hibernate, then Vlad “High-Performance DB” Mihalcea has [nine tips for us](https://vladmihalcea.com/tips-oracle-jpa-hibernate/):
- Configure the Buffer Pool and OS cache
- Optimize for the execution plan cache
- Enable the JDBC statement cache mechanism
- Increase the default JDBC statement fetch size
- Enable automatic JDBC batching
- Prefer `SEQUENCE` over `IDENTITY`
- Use the Hibernate `@RowId` when mapping JPA entities
- Store non-structured data in JSON column types
- Learn all supported SQL features

The article tells you why and how to do apply these.

[Article](https://vladmihalcea.com/tips-oracle-jpa-hibernate/)

***

### Releases
#### Spring Framework 5.3.9 & 5.2.16
The “framework that’s inside Spring Boot” has two maintenance releases: 5.3.9 includes [45 fixes and improvements](https://github.com/spring-projects/spring-framework/releases/tag/v5.3.9), while 5.2.16 [has 12](https://github.com/spring-projects/spring-framework/releases/tag/v5.2.16.RELEASE). The upcoming Spring Boot 2.5.3 and 2.4.9 releases will use Spring 5.3.9 (possibly landing at the end of this week already).

[Announcement](https://spring.io/blog/2021/07/14/spring-framework-5-3-9-and-5-2-16-available-now), [5.3.9 changelog](https://github.com/spring-projects/spring-framework/releases/tag/v5.3.9), [5.2.16 changelog](https://github.com/spring-projects/spring-framework/releases/tag/v5.2.16.RELEASE)

***

#### Quarkus 2.0.2
[Last week](https://bpfnl.substack.com/p/how-to-build-java-applications-today-6e6) I wrote about the first maintenance release of Red Hat’s modern microservice framework. Here’s the second one with more fixes.

[Announcement](https://quarkus.io/blog/quarkus-2-0-2-final-released), [changelog](https://github.com/quarkusio/quarkus/releases/tag/2.0.2.Final)

***

#### Hibernate ORM 5.3.21.Final
This small maintenance release contains [10 bug fixes, 1 improvement, and 11 tasks](https://hibernate.atlassian.net/secure/ReleaseNote.jspa?version=31897&styleName=Html&projectId=10031).

[Announcement](https://in.relation.to/2021/07/16/hibernate-orm-5321-final-out/), [changelog](https://hibernate.atlassian.net/secure/ReleaseNote.jspa?version=31897&styleName=Html&projectId=10031)

***

#### Spring Data 2021.0.3 & 2020.0.11
Both releases use Spring Framework 5.3.9 (see above). As usual with Spring Data releases, please see [the announcement](https://spring.io/blog/2021/07/16/spring-data-2021-0-3-and-2020-0-11-released) for the detailed changes in the 15 (2021.0.3) and 16 (2020.0.11) sub-projects.

[Announcement](https://spring.io/blog/2021/07/16/spring-data-2021-0-3-and-2020-0-11-released)

***

## 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 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), and [GitHub](https://github.com/ksilz). Karsten is also an [author at InfoQ](https://www.infoq.com/profile/Karsten-Silz).