Today’s recommendation:

  • Github star 100K! What is the latest Java Learning Roadmap for 2021?
  • Github 100K Star’s Java Learning/Interviewing Guide

Last weekend I posted a post titled: Spring Announcement: Kill Spring 5.3.x! This article covers the latest news on Spring Framework 6 and Spring Boot 3.

I mentioned that Spring Framework 6 and Spring Boot 3 require at least JDK 17 at runtime.

Just the day before yesterday, Oracle officially announced the release of Java 17. Yes! It is coming!

As the official says:

  • JDK 17 will replace JDK 11 as the next long-supported JDK release.
  • Java 17 offers thousands of performance, stability, and security updates, as well as 14 Jeps (JDK enhancement recommendations) that further improve the Java language and platform to help developers be more productive.

Even if you don’t use Java17 for the time being, I recommend that you stay up to date on the latest technology developments.

At present, most domestic companies still stick to Java8, I think if the project is qualified, we can try to use the new version of JDK.

Perhaps because of my busy work schedule, I have found that many people are a little resistant to “new technology” and have a strong sense of sticking to Java8. As expected single-minded, really good man!

In fact, the most commonly used framework for Java development in recent years is Spring, which has hardly changed much. Including, Spring Boot only makes it easier for us to use, and the learning cost is very low.

Look at the speed at which the front-end framework is being updated, and you’ll see what perversion is!

To tell the truth. I am very much looking forward to this update. Java in cloud native era is facing unprecedented challenges, whether to continue to glory or become a thing of the past, and see the latest efforts of Java…

One reader put it well: “Learn it or not, use it or not, put it aside. At least know what the trends are!” .

Overview of new features

There are 14 jeps in Java17:

  • 306: Restore always strict floating point semantics
  • 356: Enhanced pseudo-random number generator
  • 382: New macOS rendering pipeline
  • 391: macOS/AArch64 platform support
  • 398: Applet API to mark deletion
  • 403: Strongly encapsulates JDK internal apis
  • 406: Switch Mode Matching (preview)
  • 407: RMI Activation is deleted
  • 409: Sealed
  • 410: Removes experimental AOT and JIT compilers
  • 411: Deprecated The security manager will be deleted
  • 412: External Functions and memory apis (Incubator)
  • 414: Vector API (second feature incubation)
  • 415: Context-specific deserialization filter

For details about the new features and preview features, see the Java17 official documentation.

Sealing class to positive

Sealed Classes were introduced in Java 15 and converted in Java 17.

Sealed classes can restrict the classes that inherit or implement them.

For example, the abstract class Person allows only Employee and Manager inheritance.

public abstract sealed class Person
    permits Employee.Manager {

    / /...
}
Copy the code

In addition, any class that extends a sealed class must itself be declared sealed, non-sealed, or final.

public final class Employee extends Person {}public non-sealed class Manager extends Person {}Copy the code

Strong encapsulation of JDK internal elements

Many programmers use JDK internal elements such as non-public classes, methods, and fields in ways that compromise security and maintainability.

To continue improving the security and maintainability of the JDK, all internal elements of the JDK are strongly encapsulated by default, limiting access to them, except for key internal apis such as Sun.misc.unsafe.

MacOS /AArch64 platform support

Due to widespread demand for the JDK on macOS/AArch64, Oracle announced a port of the JDK to the macOS/AArch64 platform, adding support for the new CPU family (M1) released by Apple last year.

Flag the delete Applet API

The Applet API provides a way to embed Java AWT/Swing controls into a browser web page. However, applets are now obsolete. Most of you, like me, have never used an Applet before.

The Applet API was marked as enabled in Java 9 and finally marked as removed in Java 17.

Delete the RMI Activation

RMI (Remote Method Invocation) provides Java with Remote Method Invocation capability, but is rarely used. RMI Activation provides support for activating distributed objects, but is not typically used.

RMI Activation was deprecated in Java 15 and finally removed in Java 17.