[JAVA] Organized how to interact with the JDK in stages

JDK has already advanced to 11

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.

Generational support period for Oracle JDK

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.

Java looking back on the for statement

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.

Those who are paying for oracle

** If you are using Oracle's Sustaining Support, you can forget about JDK11. ** Let's get the system up to EOS with the JDK.

Those who are not paying for Oracle

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));

People who are not using Stream

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.

People who use Stream and don't pay Oracle

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.

Development system can follow the release of JDK

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 **.

A team that seems to have two JDKs up during development

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" **

Summary or preparation

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

Organized how to interact with the JDK in stages
How to get the date in java
How to interact with a server that does not crash the app
How to set the indent to 2 single-byte spaces in the JAXB implementation of the JDK
[Personal memo] How to interact with a random number generator in Java
[Rails] How to get the user information currently logged in with devise
How to display the text entered in text_area in Rails with line breaks
[Rails] How to apply the CSS used in the main app with Administrate
How to check the logs in the Docker container
[Swift] How to link the app with Firebase
How to Install Oracle JDK 1.8 in Ubuntu 18.04 LTS?
How to build the simplest blockchain in Ruby
How to check Rails commands in the terminal
How to get the ID of a user authenticated with Firebase in Swift
[Rails] How to register multiple records in the intermediate table with many-to-many association
[Rails] How to operate the helper method used in the main application with Administrate
How to embed JavaScript variables in HTML with Thymeleaf
How to implement UICollectionView in Swift with code only
How to change the action with multiple submit buttons
How to call functions in bulk with Java reflection
How to set the display time to Japan time in Rails
[Java] How to omit the private constructor in Lombok
How to switch Tomcat context.xml with WTP in Eclipse
How to use Oracle JDK 9 EA with Travis CI
How to use Z3 library in Scala with Eclipse
[How to insert a video in haml with Rails]
How to delete untagged images in bulk with Docker
How to use JDD library in Scala with Eclipse
How to specify the resource path in HTML import
How to query Array in jsonb with Rails + postgres
How to debug the generated jar file in Eclipse
[Rails] How to display an image in the view
How to get jdk etc from oracle with cli
`bind': Address already in use --bind (2) for 127.0.0.1:3000 (Errno :: EADDRINUSE) How to deal with the error
How to save a file with the specified extension under the directory specified in Java to the list
Summary of how to use the proxy set in IE when connecting with Java
How to number (number) with html.erb
How to update with activerecord-import
How to write Junit 5 organized
How to install JDK8-10 (Mac)
How to get the class name / method name running in Java
How to correctly check the local HTML file in the browser
How to use the getter / setter method (in object orientation)
How to take a screenshot with the Android Studio emulator
How to set chrony when the time shifts in CentOS7
How to connect the strings in the List separated by commas
How to create a placeholder part to use in the IN clause
How to get values in real time with TextWatcher (Android)
How to retrieve the hash value in an array in Ruby
Uppercase only the specified range with substring. (How to use substring)
[With back tricks] How to introduce React to the simplest Rails
How to add the same Indexes in a nested array
How to install JDK 8 on Windows without using the installer
How to dynamically switch JDK when building Java in Gradle
How to deal with the error ERROR: While executing gem ... (Gem :: FilePermissionError)
Mapping to a class with a value object in How to MyBatis
How to derive the last day of the month in Java
How to disable existing selected items in the select box
How to switch Java in the OpenJDK era on Mac
How to set up a proxy with authentication in Feign
[Rails] How to display information stored in the database in view