I think that the Java community is busy with the changes in the release cycle of Oracle and the license support form these days. Paid support is difficult in terms of cost, and there are many cases where the release cycle is difficult as short as half a year, so AdoptOpenJDK seems to be one of the leading candidates as an option. I tried to explore and introduce it, so I will summarize it here.
** Supplement. At first, I intended to change the article up to AdoptOpenJDK 11. I was writing this article while upgrading the application version, but on the way I found out that the core library does not support Java 9 or later. I will try it on another occasion to complete the article, but until then I can only write up to AdoptOpenJDK Java 9. ** **
from Java:Oracle Java 8 to java:AdoptOpenJDK9 OS:Windows 64bit、Linux(CentOS)64bit
Download from AdoptOpenJDK. The latest release page may only be built for a single platform, so I think it's better to select it individually from the archive page below. https://adoptopenjdk.net/archive.html
It doesn't come with an installer like Oracle java. The official installation method is briefly explained below, but it's a little subtle (I don't use JAVA_HOME), so I'll change it a little. https://adoptopenjdk.net/installation.html?variant=openjdk8&jvmVariant=hotspot
Java8 First from Java 8. As a premise, the original Java is 8, so it should work without problems.
-(Supplement) UNIX-like only: About securerandom.source
Although it is limited to UNIX environment, it is easy to forget to change the setting value of securerandom.source, so note it here. The initial setting for random number generation is "/ dev / random", but it doesn't need to be so strict, and the delay due to the exhaustion of random numbers is more problematic, so I changed the setting to "/ dev / urandom". I think there are many environments. In such an environment, it is necessary to remember to change the settings after installing Adopt Open JDK as well as the existing settings. Don't forget to change the settings for ** each version **. Click here for how to change settings, etc .: http://otndnld.oracle.co.jp/document/products/E13153_01/wlcp/wlss40/configwlss/jvmrand.html
Java9 Onimon causes a number of problems due to configuration changes using the module function "Project Jigsaw". For reference, I stumbled a little. The [Java 9 Migration Guide] issued by Oracle (https://docs.oracle.com/javase/jp/9/migrate/toc.htm#JSMIG-GUID-7744EF96-5899-4FB2-B34E-86D49B2E89B6) is a must read.
--Gradle doesn't work
Older Gradle will give the error "Could not determine java version from". https://qiita.com/Kaoru_Yamamoto/items/dcb3815795d6e752cff3
--Illegal Access To Internal APIs warning occurs
Some of Java's internal APIs that were not supposed to be used from the outside could be used up to Java 8, but they are now restricted. Limits mean that they are no longer available or you get a WARN warning. [Countermeasure ①] (Fundamental support) Rewrite the source to the alternative API. [Countermeasure ②] (Temporary support) Add Java startup option "--add-exports (corresponding API)". [Countermeasure ③] (Temporary support) Add Java startup option "--add-opens (corresponding API)". This is an option if you are operating the API with reflection.
The provisional support is a transitional measure and may not be available in future versions, so it is necessary to take fundamental measures as soon as possible.
https://blog.codefx.org/java/java-9-migration-guide/#Illegal-Access-To-Internal-APIs
Recommended Posts