javax.xml.bind problem in Java 11
How to solve the problem that javax.xml.bind package does not exist in Java 11?
According to the release documentation, Java EE modules have been removed in Java 11:
Passed This problem can be solved by using alternative versions of Java EE technology. Just add the Maven dependency containing the required classes:
javax.xml.bind jaxb-api 2.3.0 com.sun.xml.bind jaxb-core 2.3.0 com.sun.xml.bind jaxb-impl 2.3.0
Jakarta EE 8 Update (March 2020)
It is possible to use the Jakarta XML Binding in Jakarta EE 8 instead of the old JAXB module:
jakarta.xml.bind jakarta.xml.bind-api 2.3.3 com.sun.xml.bind jaxb-impl 2.3.3 runtime
Jakarta EE 9 Update (November 2020)
Use the latest version of Jakarta XML Binding 3.0:
jakarta.xml.bind jakarta.xml.bind-api 3.0.0 com.sun.xml.bind jaxb-impl 3.0.0 runtime
Note: Jakarta EE 9 adopts the new API package namespace jakarta.xml.bind.*, so please update the import statement:
javax.xml.bind -> jakarta.xml.bind
Jakarta EE 10 Updated (June 2022)
Use the latest version of Jakarta XML Binding 4.0 (requires Java SE 11 or higher):
jakarta.xml.bind jakarta.xml.bind-api 4.0.0 com.sun.xml.bind jaxb-impl 4.0.0 runtime
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3