15.9.2 Removed Features Explained
Java SE 11 introduced several changes, including the removal of certain features that were deprecated in previous versions. Understanding these removed features is crucial for developers to ensure compatibility and to write modern, efficient Java code.
Key Concepts
1. Removal of Java EE and CORBA Modules
Java SE 11 removed the Java EE (Enterprise Edition) and CORBA (Common Object Request Broker Architecture) modules. These modules were previously included in the JDK but were moved to separate projects to streamline the core JDK.
Example
If your application relied on Java EE modules like JAX-WS (Java API for XML Web Services), you would need to include these dependencies separately. For example:
<dependency> <groupId>javax.xml.ws</groupId> <artifactId>jaxws-api</artifactId> <version>2.3.1</version> </dependency>
2. Removal of JavaFX
JavaFX, which was previously part of the JDK, was also removed in Java SE 11. JavaFX is now a separate project and needs to be included as an external dependency if your application requires it.
Example
To use JavaFX in your project, you would need to add the following dependencies:
<dependency> <groupId>org.openjfx</groupId> <artifactId>javafx-controls</artifactId> <version>11</version> </dependency>
3. Removal of Java Web Start
Java Web Start, a technology used to launch Java applications over a network, was removed in Java SE 11. Developers need to explore alternative deployment methods for their applications.
Example
Instead of using Java Web Start, consider using native installers or container-based deployment solutions like Docker.
4. Removal of Nashorn JavaScript Engine
The Nashorn JavaScript engine, which was introduced in Java 8, was removed in Java SE 11. Developers who relied on Nashorn for JavaScript execution need to use alternative engines like GraalVM.
Example
To use GraalVM for JavaScript execution, you would include it as a dependency:
<dependency> <groupId>org.graalvm.js</groupId> <artifactId>js</artifactId> <version>20.3.0</version> </dependency>
Examples and Analogies
Think of the removal of these features as a house cleaning process. Just as you would remove old, unused items from your home to make space for new ones, Java SE 11 removed deprecated features to streamline the JDK and encourage the use of modern, efficient alternatives.
For instance, if you were using Java Web Start to deploy your application, it would be like relying on an old, outdated delivery method. Moving to a native installer or container-based deployment is akin to adopting a more efficient, modern delivery system.
By understanding and adapting to these changes, you can ensure that your Java applications remain compatible with the latest JDK versions and take advantage of modern, efficient tools and technologies.