Java 11 was released on September 25, 2018.
Below is the JEP in Java 11.
From JDK9 onwards, the release model has been changed to feature releases every 6 months (March and September). In addition, vulnerability countermeasures and bug fixes have been fixed so that they can be addressed four times a year in January, April, July, and October. Regarding binary provision Until now, binaries were provided free of charge by Oracle, but after 9 the free binaries will be provided by OpenJDK. Oracle JDK 9 or later will be charged. Also, before 8, there was a technical difference between Oracle JDK and OpenJDK, but this has disappeared.
LTS After JDK11 Oracle JDK will be released once every three years. Paid support for Oracle Provides security updates for a minimum of 8 years. In addition, after JDK11, it will be available free of charge for development, testing, prototyping, and demo applications.
A Japanese document called Java Is Still Free written by dozens of Java champions regarding Java support and updates has been released. It was.
JEP181 Nest-Based Access Control Until Java10, the code that called the private method of the outer class from the inner class was a strange bytecode output.
Let's take a look at the following code in JDK10.
Outer.java
public class Outer {
private int i = 0;
public class Inner {
public int i() {
return i;
}
}
}
After compiling, try disassembling the class files.
python
$ javap -p -c Outer\$Inner
Compiled from "Outer.java"
public class Outer$Inner {
final Outer this$0;
public Outer$Inner(Outer);
Code:
0: aload_0
1: aload_1
2: putfield #1 // Field this$0:LOuter;
5: aload_0
6: invokespecial #2 // Method java/lang/Object."<init>":()V
9: return
public int i();
Code:
0: aload_0
1: getfield #1 // Field this$0:LOuter;
4: invokestatic #3 // Method Outer.access$000:(LOuter;)I
7: ireturn
}
Next, compile the same code with JDK11 and disassemble it.
python
$ javap -p -c Outer\$Inner
Compiled from "Outer.java"
public class Outer$Inner {
final Outer this$0;
public Outer$Inner(Outer);
Code:
0: aload_0
1: aload_1
2: putfield #1 // Field this$0:LOuter;
5: aload_0
6: invokespecial #2 // Method java/lang/Object."<init>":()V
9: return
public int i();
Code:
0: aload_0
1: getfield #1 // Field this$0:LOuter;
4: getfield #3 // Field Outer.i:I
7: ireturn
}
If you compiled with JDK10, the Inner class will call Outer's static method access $ 000. In JDK11, the Inner class calls the Outer class Outer.i directly instead of the access $ 000 method.
A video about this is available at the JVM Language Summit 2018.
JEP309 Dynamic Class-File Constants Extends the Java class file format to support dynamic constants. Until Java10, only Strings with primitives and literals could be stored in the Constant Pool, but other strings can now be handled in the Constant Pool. The advantage of dynamic constants seems to be that they give you more freedom in your language and compiler, and more freedom in your bytecode constants.
A video about this is available at the JVM Language Summit 2018.
JEP320 Remove the Java EE and CORBA Modules The JavaEE and CORBA modules have been removed. Targets are CORBA, JAXB, JAX-WS, Common Activation Framework, and JTA. These surrogate modules are as follows.
The reason for the deletion seems to be that the difference in development speed cannot keep up with the speed of Java SE. It seems that it will be developed as Jakarta EE in the future.
JEP321 HTTP Client (Standard) The HTTP Client API has been standardized. Asynchronous support, HTTP / 2 support. The module name is java.net.http.
A video about this has been released.
JEP323 Local-Variable Syntax for Lambda Parameters You can now use var with lambda parameters as well as local variable type inference introduced in Java 10. You can now add more annotations. A video about this has been released.
Recommended Posts