my java SE path is succesful and i updated java version recently…my java previous version is java 9 and i updated to 11.
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
how to fix this,no class found error in java ?
i too faced “e java.lang.noclassdeffounderror javax/xml/bind/jaxbexception” same java exception and solved it by adding the following dependencies to the build
the jaxb-api and jaxb-runtime.That’s it your above error will gets solved.
i will drop the dependencies to add to your build to get rid of this e java.lang.noclassdeffound error…..
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.7.0</version>
</dependency>
after adding this,try to execute your build and check whether your problem is fixed. Many are facing this exception when they are updating java to any version above 9.
Namrata Podder
The main reason for getting e java.lang.noclassdeffounderror javax/xml/bind/jaxbexception error is :
The JAXB APIs are considered to be Java EE APIs and therefore are no longer contained on the default classpath in Java SE 9. In Java 11, they are completely removed from the JDK.
Fortunately, these Java EE APIs that were provided in JDK 6/7/8 are still in the JDK, but they just aren’t on the classpath by default.
The dependencies for this is to be added manually
The solution for the java.lang.noclassdeffounderror javax/xml/bind/jaxbexception
Just add the following dependencies to your pom.xml file
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.7.0</version>
</dependency>
Hope it helps!