Honoring its commitment, Oracle delivered the new Java 10 in time. The coming of it i.e., JDK 10, an implementation of Java Standard Edition 10 was well received. Why? Quite a lot of tool and framework manufacturers weren’t proficient with the Java 9 and were still busy adapting to the new module system. As such, the change in the scheme of things helped users to cope up with the task quickly.
New features in Java 10
So, what’s all new in Java 10? Firstly, a great deal of attention has been rightfully focused on the newest features of Java, including the introduction of-
- Local variable type inference – The feature aims to enhance the Java language to extend type inference to declarations of local variables with initializers. It claims to be the only real feature for developers in JDK 10.
- Provision of a default set of root certificate authority certificates in the JDK -The major objective behind this is to open-source root certificates in Oracle’s Java SE Root CA program to make OpenJDK builds more appealing to developers. Also, as the description reads, the beneficial addition will provide a default set of root Certification Authority (CA) certificates in the JDK.
- Application class-data sharing to optimize startup time and footprint – CDS (class-data sharing) was first introduced in JDK 5 in attempt to improve the performance of the JVM startup and reduce the resource footprint when multiple JVMs were running on the same physical machine. JDK 10 will extend CDS functionality so application classes can also be placed in the shared archive. Previously, use of CDS had been restricted to the bootstrap class loader only.
- Docker awareness – Beginning now, in any instance where you chose to run Java 10 on Linux systems, the Java Virtual Machine (JVM) will quickly recognize if it is running in a Docker container. Container-specific information like the number of CPUs and total memory allocated to the container will be extracted by the JVM instead of it querying the operating system.
- Additional JVM options – the new options will offer Docker container users greater control over system memory.
- Bug fixes – A bug fix to correct the attachment mechanism when trying to attach from a host process to a Java process that is in a Docker container.
- New APIs – Java 10 will feature new APIs to better enable the creation of unmodifiable collections. The copyOf, Set.copyOf, and Map.copyOf methods create new collection instances from existing instances. New methods toUnmodifiableList, toUnmodifiableSet, and toUnmodifiableMap were added to the Collectors class in the Stream package, allowing the elements of a Stream to be collected into an unmodifiable collection.
- Garbage Collector Interface: In earlier JDK structure, the components that made up a Garbage Collector (GC) implementation were scattered throughout various parts of the code base. While they appeared known to those familiar with the GC scheme used by the JDK, it often resulted in confusion for newer developers. It’s changed in Java 10. Now, it is a clean interface within the JVM source code to allow alternative collectors to be quickly and easily integrated. It will improve source-code isolation of different garbage collectors.
- Aggregation of the repositories of the JDK forest into a single repository – The code base until now was broken into multiple repos, which can cause problems with source-code management. So, in an effort to streamline the development, eight repos:
- Previously available in JDK 9 were merged into a single repository to perform an atomic commit across repositories of inter-dependent changesets.
Grall Java-based just-in-time compiler
Lastly, Graal which lets programmers create runtimes and compilers for new or existing languages in Java has been enabled as the Grall Java-based just-in-time compiler to be used in an experimental fashion on the Linux/x64 platform.
Oracle promises it will continue to offer long-term releases on a regular basis and at regular intervals. For more information, refer to this page.
- Tags: Java