DEV Community

Ștefan Vîlce
Ștefan Vîlce

Posted on

Java error: import javax.xml.bind.JAXB

I work at one project which is developed on Java 8 (i.e. Java 1.8). I cloned the repo on my computer, I have installed the dependencies and I got this error:

Image description

The import javax.xml.bind.JAXBException cannot be resolved

Since Java 11 this library is not contained anymore in Java. I'm running Java 14. So, I don't have it. To fix this I had to add this dependency in pom.xml

<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.1</version>
</dependency>
Enter fullscreen mode Exit fullscreen mode

And that has fixed the project.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay