Java JDK 10 – Features To Explore In Java 10

 

JDK 10, an implementation of Java Standard Edition 10, was released on March 20, 2018.  Key improvements include local variable types as well as enhancements for garbage collection and compilation.

 

JDK 10 is scheduled to be just a short-term release, and public updates for JDK 10 are slated to end in six months. The upcoming JDK 11, due in September, will be a long-term support (LTS) version of Java. LTS releases are due every three years.

 

Oracle has set a six-month release cadence for Java releases.

 

There had been plans to name this upgrade and successors based on the year and month of the release, with the first release to be called Java 18.3.  But those plans were scrapped after objections were raised.

Where to download Java JDK 10

 

You can download JDK 10 from Oracle’s website.

New and improved features in JDK 10

 

Key features in JDK 10 include:

 

  • Local variable type inference, to enhance the Java language to extend type inference to declarations of local variables with initializers.

 

  • Parallel full garbage collection for the G1 garbage collector, to improve worst-case latencies.

 

  • Application class-data sharing to optimize startup time and footprint. The existing Class-Data Sharing feature is extended so application classes can be placed in the shared archive.

 

  • An experimental just-in-time compiler, Graal, can be used on the Linux/x64 platform.

 

  • Docker awareness. When running on Linux systems, the Java Virtual Machine (JVM) will know if it is running in a Docker container.  Container-specific information—the number of CPUs and total memory allocated to the container—will be extracted by the JVM instead of it querying the operating system. (The number of CPUs available to the Java process is calculated from specified sets, shares or quotas of processors.)

 

  • Three new JVM options, to give Docker container users greater control over system memory.

 

  • A bug fix to correct the attach mechanism when trying to attach from a host process to a Java process that is in a Docker container.

 

  • Shorter startup times for the jShell REPL tool, particularly when a start file with many snippets is in use.

 

  • New APIs to better enable creation of unmodifiable collections. The copyOf,Set.copyOf, and Map.copyOf methods create new collection instances from existing instances. New methods toUnmodifiableListtoUnmodifiableSet, and toUnmodifiableMap were added to the Collectors class in the Stream package. It allows the elements of a Stream to be collected into an unmodifiable collection.

 

  • A local-variable type inference, to enhance the language to extend type inference to local variables. The intent is to reduce the “ceremony” associated with coding while maintaining a commitment to static type safety.

 

  • A clean garbage collector interface to improve source-code isolation of different garbage collectors. The goals for this effort include better modularity for internal garbage collection code in the HotSpot virtual machine. Also making it easier to add a new garbage collector to HotSpot.

 

  • Parallel full garbage collection for the G1 garbage collector.  The intent is to improve worst-case latencies by implementing parallelism.

 

  • Enabling HotSpot to allocate the object heap on an alternative memory device, such as an NVDIMM memory module, specified by the user.  This feature envisions that future systems may have heterogeneous memory architectures.

 

 

  • Consolidation of the repositories of the JDK forest into a single repository, to streamline development. The code base until now has been broken into multiple repos, which can cause problems with source-code management.

 

  • Application class-data sharing, to reduce the footprint by sharing common class metadata across processes. Startup time is improved as well.

 

  • Thread-local handshakes, for executing a callback on threads without performing a global VM safepoint. Individual threads could be stopped instead of either all threads or no threads.

 

  • Provision of a default set of root certificate authority certificates in the JDK. The goal is to open-source root certificates in Oracle’s Java SE Root CA program to make OpenJDK builds more enticing to developers.

 

Source from www.infoworld.com