Java 11 - Removal of Java EE modules (JEP 320)

[Last Updated: Sep 27, 2018]

In Java 9, the modules which contain Java EE technologies were deprecated for removal in a future release.
The flag --add-modules can be used in JDK 9 to resolve these modules.

Java 11, removes all JEE related modules (JEP 320). Now --add-modules no longer works.
In Java 11, these JEE technologies can be deployed in class path (or module path for modular applications).

The following example shows how to use JAXB API using maven dependencies.



<project .....>


public class MsgObj {
  private String msg;
public class MsgUnMarshaller {
  public static void main(String... st) throws JAXBException {
      JAXBContext jaxbContext = JAXBContext.newInstance(MsgObj.class);
      Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();

      StringReader reader = new StringReader("<msgObj><msg>test msg</msg></msgObj>");
      MsgObj msgObj = (MsgObj) unmarshaller.unmarshal(reader);
MsgObj{msg='test msg'}

Example Project

Dependencies and Technologies Used:

  • jaxb-runtime JAXB (JSR 222) Reference Implementation.
  • activation 1.1.1: The JavaBeans(TM) Activation Framework is used by the JavaMail(TM) API to manage MIME data.
  • JDK 11
  • Maven 3.5.4

Java 11 - Using JAXB after JEE removal Select All Download
  • java11-jee-module-removal
    • src
      • main
        • java
          • com
            • logicbig
              • example
    • pom.xml

    See Also