Replacements for deprecated JPMS modules with Java EE APIs

后端 未结 8 1360
滥情空心
滥情空心 2020-11-22 05:23

Java 9 deprecated six modules that contain Java EE APIs and they are going to be removed soon:

  • java.activation with javax.activation pack
相关标签:
8条回答
  • 2020-11-22 06:28

    Im using jdk 11 + ant + ivy in my spring mvc project. I was getting error "package javax.jws does not exist" so I added javax.jws-api-1.1.jar to classpath and it worked! Just download the jar from https://repo1.maven.org/maven2/javax/jws/javax.jws-api/1.1/javax.jws-api-1.1.jar And add it to your classpath in your build.xml

    0 讨论(0)
  • 2020-11-22 06:29

    Instead of using the deprecated Java EE modules, use the following artifacts.

    JAF (java.activation)

    JavaBeans Activation Framework (now Jakarta Activation) is a standalone technology (available on Maven Central):

    <dependency>
        <groupId>com.sun.activation</groupId>
        <artifactId>jakarta.activation</artifactId>
        <version>1.2.2</version>
    </dependency>
    

    (Source)

    CORBA (java.corba)

    From JEP 320:

    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 GlassFish and its implementation of CORBA and RMI-IIOP).

    JTA (java.transaction)

    Stand alone version:

    <dependency>
        <groupId>jakarta.transaction</groupId>
        <artifactId>jakarta.transaction-api</artifactId>
        <version>1.3.3</version>
    </dependency>
    

    (Source)

    JAXB (java.xml.bind)

    Since Java EE was rebranded to Jakarta EE, JAXB is now provided by new artifacts:

    <!-- API -->
    <dependency>
        <groupId>jakarta.xml.bind</groupId>
        <artifactId>jakarta.xml.bind-api</artifactId>
        <version>2.3.3</version>
    </dependency>
    
    <!-- Runtime -->
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.3.3</version>
        <scope>runtime</scope>
    </dependency>
    

    JAXB Reference Implementation page.

    schemagen and xjc can be downloaded from there too as part of a standalone JAXB distribution.

    See also linked answer.

    JAX-WS (java.xml.ws)

    Reference implementation:

    <!-- API -->
    <dependency>
        <groupId>jakarta.xml.ws</groupId>
        <artifactId>jakarta.xml.ws-api</artifactId>
        <version>2.3.3</version>
    </dependency>
    
    <!-- Runtime -->
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <version>2.3.3</version>
    </dependency>
    

    Standalone distribution download (contains wsgen and wsimport).

    Common Annotations (java.xml.ws.annotation)

    Java Commons Annotations (available on Maven Central):

    <dependency>
        <groupId>jakarta.annotation</groupId>
        <artifactId>jakarta.annotation-api</artifactId>
        <version>1.3.5</version>
    </dependency>
    

    (Source)

    0 讨论(0)
提交回复
热议问题