JDK 11 was released on September 2018. Have you already installed it? Isn't it the person who chose the Oracle version that they are used to, or the person who installed OpenJDK for the first time? All the Java evangelists in the world are giving us the JDKs to choose from from various perspectives. This is very helpful information. So what should we do if we are using JDK 5 or 6 now in this article? I would like to respond to the voiceless voice.
First, how was the support period for the Oracle JDK in the past? As you can see, ** long release intervals and long maintenance periods **
--JDK1.4 2000 release --JDK5 2004 release Official update finished October 2009 --JDK6 2006 release, official update finished, February 2013 --JDK7 2011 release Official update finished April 2015 --JDK8 2014 release Official update finished January 2019 --JDK9 2017 release, official update finished, March 2018 --JDK10 2018 release Official update finished September 2018 --JDK11 2018 release
However, the era of slow flow of time is over. However, please read the projects and teams that have been spending time in the slow flow of the past.
JDK1.4
int[] array = new int[10];
for(int i = 0; i < 10; i++) {
System.out.println(array[i]);
}
In 2002, Java was at the cutting edge. If you have a system that is still running at 1.4, why not worry about JDK 11 now? Let's continue writing Java with Hidemaru forever.
JDK5/6/7
int[] array = new int[10];
for(int i: array) {
System.out.println(i);
}
An era when writing extended for statements was a status. I miss the time when the existing for statement was rewritten as refactoring without any meaning. I think that people using JDK5 / 6/7 can actually be divided into two types. Some people pay for Oracle and others don't.
** If you are using Oracle's Sustaining Support, you can forget about JDK11. ** Let's get the system up to EOS with the JDK.
If you're using a JDK that was out of support in April 2015, you probably don't intend to update it. Let's go straight to EOS. ** However, I think the system will be used for another 10 years, so be careful of security incidents. ** **
JDK8
int[] array = new int[10];
Arrays.stream(array).forEach(arr -> System.out.println(arr));
Stream. The process can be executed without writing a for statement already. If you look at this and wonder, "Is this Java?", You don't have to worry about JDK 11. Let's do our best with JDK8 for another 10 years until the system reaches EOS.
This is the most difficult. Probably, it must be an active crunchy system made with JDK8 from the beginning. And I would like to recommend it to those people ** Don't be tied to the Java version anymore **. Take the plunge and consider migrating to Open JDK 11. Support will expire in early 2019. And in the current situation without LTS, it's the same for any JDK. ** I understand that I'm afraid that "building with a different JDK will require all tests". ** But do you know when the JDK was built for Apache commons etc. that you already use in your application? Maybe it's horribly old. For the time being, let's build it with JDK11 and run it. ** Please note that JDK11 has the JAVAEE library deleted in a sloppy manner **, so you have to add that part with maven or gradle. As expected, Java 8 would be using a build tool, so it would be easy to handle.
JDK9/10/11
int[] array = new int[10];
Arrays.stream(array).dropWhile(arr -> array <= 1).forEach(System.out::println);
Since I'm writing dropWhile, I've changed the spec, but aside from that, a new method has been added to Stream. Java is getting better and better. Many people are already indistinguishable from JavaScript by looking at this writing style. Those at this stage will have already tried JDK 11. That's fine. However, here too, it will be roughly divided into two patterns.
If you're an agile team whose app release is aligned with the six-month JDK release timing, be sure to follow the JDK version. Even if it is attached, ** I don't think there is any benefit to the customer, but it may be good only in terms of security **.
Let's specify it in the proposal. ** "This development will be built with JDK11 and released. We will not check the operation with other JDKs" **
I also write horror stories, but in any case, those who will continue to do Java must learn how to write in the Java 8 era. The person who writes the for statement has no choice but to leave. I highly recommend the following: I read a lot myself Read first to understand Java 8 style
Java SE 8 Practical Programming that Java Programmers Should Learn Introduction to Java-From basics in modern style to object-oriented / practical libraries
And it is recommended to try building an application with Spring Boot, which has changed the way Java Web applications are created. What's amazing is that of Auto Configuration. It makes me think that I'm writing ASP.NET in C #, or I think I'm writing Angular.
I recommend Spring Boot for the first time, but it's a little older than Ver1. There is also a book for Ver2, and I read it, but it is not a transcendental recommendation. But it's better to read it than not to read it, so I'll list it. ** The reason is that creating an app with Spring Boot is as close to the limit as possible **. It should be noted that it is important to thoroughly understand the framework specifications in order not to write too much code. First Spring Boot Introduction to Spring Boot 2
Recommended Posts