I am trying to run "mvn clean install" command, but I get the following error:
java:[42,22] package javax.xml.bind does not exist
Do you have any idea why?
I am trying to run "mvn clean install" command, but I get the following error:
java:[42,22] package javax.xml.bind does not exist
Do you have any idea why?
Try adding
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
into your pom.xml file
mvn clean install -DskipTests
... I'm not a java developer so I don't know if skipping these tests were a good idea.
Commented
Apr 10, 2022 at 19:46
The library javax.xml.bind
has been removed from Java 11 release.
Release Notes
For fixing this you have add those dependencies explicitly in your POM file or add it to your classpath accordingly.
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.1</version>
</dependency>
After adding it to your POM you can build the maven project. First time you can skip tests.
mvn clean install -DskipTests
Download jaxb API jar file, and add it as an external jar to the Java build path.