Java update for Scala users

Motivation

I have to upgrade it regularly ... Updates to Java 11 and above seemed to have a lot of fascinating power-ups. (Of course, every version upgrade is attractive!) Why move to Java 11-Azure | Microsoft Docs

environment

  1. The application writes Scala and runs on the JVM.
  2. Scala uses 2.13.1.
  3. You are using Adopt OpenJDK.

Check the combination of Scala and JVM version

First of all, here is the version of Scala and JVM https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html We generally recommend JDK 8 or 11 for /compiling/ Scala code. There is, but this time the purpose is the version of the application runtime, so don't worry about it.

As for the version of Scala, I found out that it seems to be available in 11, 12, 13, 14 (there are 15 but not yet released at that time).

Java version to aim for

There was a lot of information on the transition to Java 8-> Java 11 in the streets, so I decided to aim for Java 11 for the time being in this update.

I read around various articles and blogs Migrating from Java 8 to Java 11-Azure | Microsoft Docs Was helpful.

Since I am using Scala, I rarely use Java API directly from the application, so I did not have to do almost anything, but since there were some correspondences, I will pick it up below

Check GC options

It's as below. Migrating from Java 8 to Java 11-Azure | Microsoft Docs If the application updated this time is G1 GC, the performance will be inferior to Parallel GC, and if you miss the heap size, number of CPUs, and application features, you will be surprised that the performance will drop, so be sure to check it.

An illegal reflective access operation has occurred from the library you were using

From the library I was using An illegal reflective access operation has occurred Was generated and the log was output. I decided to add --illegal-access * = warn to the Java startup option and leave it as a warn log. Migrating from Java 8 to Java 11-Azure | Microsoft Docs

Graduation from Jetty ALPN Agent

I encountered the following while working Jetty-alpn 8.1.13 is incompatible with the latest jdk8u252-ga build · Issue #30 · jetty-project/jetty-alpn · GitHub

Guided by the issue, I came across the following article. Jetty, ALPN & Java 8u252 – Webtide Apparently jetty-alpn-agent doesn't have to be specified anymore.

Originally, jetty-alpn-agent was used as java-agent to support http/2, but it is no longer necessary because it was supported by Java itself in the following update. JEP 244: TLS Application-Layer Protocol Negotiation Extension

Correspondence to change the position of java.security file

Originally $ JAVA_HOME/jre/lib/security/java.security There was also a file in Java 11 The location has changed to $ JAVA_HOME/conf/security/java.security.

Java Security Overview If you look at, the location of the file is written.

Finally

Fortunately, we didn't need much support because our application wasn't a problem with the libraries we were using from Scala.

With the update, the number of GCs has calmed down, and it has become possible to use Java Flight Recorder and convenient tools that assume Java 11.

Recommended Posts

Java update for Scala users
For JAVA learning (2018-03-16-01)
2017 IDE for Java
Java for statement
[Java] for statement, while statement
[Java] Package for management
[Java] for statement / extended for statement
Countermeasures for Java OutOfMemoryError
NLP for Java (NLP4J) (2)
(Memo) Java for statement
NLP for Java (NLP4J) (1)
Summary for intermediate users based on Java introductory practice
Java debug execution [for Java beginners]
[Java] Basic statement for beginners
[Java] Precautions for type conversion
Books used for learning Java
2018 Java Proficiency Test for Newcomers-Basics-
Multi-stage selection (Java / Groovy / Scala)
Java thread safe for you
[Java] Summary of for statements
Java for beginners, data hiding
[Java] Tips for writing source
Java installation location for mac
Java application for beginners: stream
Java while and for statements
List data structure [Java / Scala]
[For beginners] Minimum sample to update RecyclerView with DiffUtils in Java
Think of a Java update strategy
C # cheat sheet for Java engineers
[Java, Scala] Image resizing with ImageIO
Do Scala Option.or Null in Java
[For beginners] Summary of java constructor
AWS SDK for Java 1.11.x and 2.x
Rock-paper-scissors game for beginners in Java
Java for beginners, expressions and operators 1
[Java] Memo for naming class names
[For beginners] Run Selenium in Java
[Java] How to update Java on Windows
Hello World for ImageJ Java Plugin
[OpenCV3.2.0] Eclipse (Java) settings (for Mac)
Use JDBC with Java and Scala.
Java for beginners, expressions and operators 2
Enable OpenCV with java8. (For myself)
Spring Framework tools for Java developer
java (use class type for field)
Build Java development environment (for Mac)
[Java] Reference / update of Active Directory
EXCEL file update sample with JAVA
[Java & SpringBoot] Environment Construction for Mac
Settings for SSL debugging in Java
Generics of Kotlin for Java developers
Call TensorFlow Java API from Scala
Diary for Java SE 8 Silver qualification
[For Java beginners] About exception handling
Classes and instances Java for beginners
Modern best practices for Java testing