Removed jars and modules in JDK 11

Solution Verified - Updated

Environment

  • OpenJDK 11

Issue

  • What are the removed modules in JDK 11?
  • What are the deprecated modules in JDK 11?
  • Were the CORBA Module removed in JDK 11?
  • How to replace the CORBA Module in JDK 11?
  • How to migrate for JDK 11?

Resolution


Disclaimer: Links contained herein to an external website(s) are provided for convenience only. Red Hat has not reviewed the links and is not responsible for the content or its availability. The inclusion of any link to an external website does not imply endorsement by Red Hat of the website or their entities, products or services. You agree that Red Hat is not responsible or liable for any loss or expenses that may result due to your use of (or reliance on) the external site or content.


This solution clarifies the Modules Removed in JDK 11, the Backward Compatibility, the JDK 11 Migration Guide, and the suggestions for Corba replacement. And sun.Reflect removal

This is also clarified in the solution APIs JAXB / JAX-WS / JAF / CORBA / JTA deprecated in JDK 9 and removed from JDK 11

List of removed modules in Content from openjdk.java.net is not included.JEP 220

  • rt.jar
  • tools.jar
  • dt.jar

JDK 11 (JDK 9+) no longer contains the files lib/rt.jar, lib/tools.jar, lib/dt.jar, and other internal JAR files. Existing code that assumes the existence of these files might not work correctly.

List of removed modules in JEP 320

The list of removed modules in JDK 11 is the following (these modules were deprecated and marked for removal in JDK 9):

  • java.xml.ws: Java API for XML Web Services (JAX-WS), Web Services Metadata for the Java Platform, and SOAP with Attachments for Java (SAAJ)
  • java.xml.bind: Java Architecture for XML Binding (JAXB)
  • java.xml.ws.annotation: The subset of the JSR-250 Common Annotations defined by Java SE to support web services
  • java.corba: CORBA (and all the packages part of CORBA, including javax.activity)
  • java.transaction: The subset of the Java Transaction API defined by Java SE to support CORBA Object Transaction Services
  • java.activation: JavaBeans Activation Framework
  • java.se.ee: Aggregator module for the six modules above
  • jdk.xml.ws: Tools for JAX-WS
  • jdk.xml.bind: Tools for JAXB

Reflection

Reflection is preferably be done via StackWalker rather than Content from bugs.openjdk.java.net is not included.sun.Reflect, which deprecated in JDK 9 and was removed on JDK 11. JDK still has java.base/jdk/internal/reflect/Reflection, but set as internal inside a module named Content from bugs.openjdk.org is not included.jdk.unsupported - this module contains sun/misc classes.

Backwards compatibility

Existing code with references to classes in these APIs will not compile without changes to the build. Similarly, code on the classpath with references to classes in these APIs will fail with NoDefClassFoundError or ClassNotFoundException unless changes are made in how the application is deployed.

See Content from openjdk.java.net is not included.JEP 320: Remove the Java EE and CORBA Modules for more information about possible replacements for the modules.

JDK 11 Migration Guide

See the Content from docs.oracle.com is not included.JDK 11 - Migration Guide for more information on the migration.

Corba Replacement

As stated in Content from openjdk.java.net is not included.JEP 320: Remove the Java EE and CORBA Modules:

There will not be a standalone version of CORBA unless third parties take over maintenance of the CORBA APIs, ORB implementation, CosNaming provider, etc. Third-party maintenance is possible because the Java SE Platform endorses independent implementations of CORBA. In contrast, the API for RMI-IIOP is defined and implemented solely within Java SE. There will not be a standalone version of RMI-IIOP unless a dedicated JSR is started to maintain it, or stewardship of the API is taken over by the Eclipse Foundation. The transition of stewardship of Java EE from the JCP to the Eclipse Foundation includes the GlassFish implementation of CORBA and RMI-IIOP. Finally, there is no standalone version of the J2EE Activity Service.

A possible replacement is Content from github.com is not included.Glassfish Corba. Use the following dependency for importing it in Maven:

        <dependency>
            <groupId>org.glassfish.corba</groupId>
            <artifactId>glassfish-corba-omgapi</artifactId>
            <version>4.2.1</version>
        </dependency>
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.