Deprecated & Removed Features
Many features have been marked as deprecated or removed since Java 11. You need to pay special attention to these features if your application still uses them.
Deprecated Features
Below are deprecated features in Java 17.
Applet API
Applet API is deprecated for removal in Java 17 (JEP 398). Since all browser vendors have either removed support for Java browser plug-in or plan to do so, removing this API is completely OK.
Applet API was previously deprecated in Java 9 (JEP 289).
Security Manager
Security Manager is deprecated for removal in Java 17 (JEP 411). java.lang.SecurityManager and other related classes and methods have been annotated with @Deprecated(forRemoval=true).
A warning message is issued when Security Manager is enabled at startup or installed dynamically at runtime.
In Java 12, the value disallow can be specified for the system property java.security.manager to disable Security Manager. In this case, no security manager is set at startup and cannot be set dynamically at runtime. Calling System::setSecurityManager always throws an UnsupportedOperationException.
More changes to security manager will come in Java 18 and later versions. In Java 18, disallow will become the default value of java.security.manager.
Security manager has been in Java since 1.0, but it’s rarely used to secure Java code in both client-side and server-side. If your application uses security manager, it’s time to plan the migration without it.
Removed Features
Below are features removed in Java 17.
Experimental AOT and JIT Compiler
The Graal compiler was incorporated into JDK as an experimental ahead-of-time (AOT) and just-in-time (JIT) compiler.
- Ahead-of-time compilation in JDK 9 (JEP 295)
- JIT compiler in JDK 10 (JEP 317).
The Graal compiler was removed in Java 17. Below is a list of what’s removed:
- Module
jdk.aot - Module
jdk.internal.vm.compiler - Module
jdk.internal.vm.compiler.management - Tool
jaotc
The experimental Java-level JVM compiler interface (JVMCI) is preserved, so you can still use externally-built versions of the Graal compiler for JIT compilation.
If you want to use the Graal compiler for either AOT or JIT compilation, you should use GraalVM directly.
RMI Activation
RMI Activation was deprecated for removal in Java 15 by JEP 385 and removed in Java 17 by JEP 407. The rest of RMI is preserved.
The package java.rmi.activation is removed.
Pack200 Tools
Pack200 is a compression scheme for JAR files. It’s been used to compress JDK and client applications since Java SE 5.0. JDK 8 was the last release compressed using Pack200. Starting from JDK 9, new compression schemes were used.
Pack200 tools and related API were deprecated for removal in Java 11 (JEP 336) and removed in Java 14 (JEP 367).
Below is a list of what’ removed:
- Tools
pack200andunpack200 - Classes
java.util.jar.Pack200,java.util.jar.Pack200.Packerandjava.util.jar.Pack200.Unpacker - Module
jdk.pack
Nashorn JavaScript Engine
The Nashorn JavaScript engine was introduced in JDK 8 (JEP 174) to replace the old Rhino scripting engine. With the rapid development of ECMAScript language specification, it becomes challenging to manage the Nashorn engine to keep up with the specification. The engine was deprecated in Java 11 (JEP 335) and removed in Java 15 (JEP 372).
Below is a list of what’ removed:
- Module
jdk.scripting.nashorn - Module
jdk.scripting.nashorn.shell - Tool
jjs
Solaris and SPARC Ports
Solaris/SPARC, Solaris/x64, and Linux/SPARC ports were deprecated for removal in Java 14 (JEP 362) and removed in Java 15 (JEP 381).