The import javax.xml.bind cannot be resolved.

Hallo Community

I am working on a project that requires the package “java.xml.bind”. But its cannot be resolved or imported. Once I type the import statement it gives an error “The import javax.xml.bind cannot be resolved”.

I am using java 8 it should be part of the JDK package correct me if am wrong. Anyone who has a solution.

kindly confirm that it truely exists.

javadoc javax.xml.bind

whats the output?

No it not there am wondering why. And i have tried to include it as a dependency in my pom file and still same error.

kindly share the section/snippet of the depedency you added to POM

It means a class you are referencing is not found anywhere on the classpath. You need the library you’re trying to use added to your classpath. In Eclipse, that’s in project properties in the Java Build Path => Libraries tab.

javax.xml.bind jaxb-api 2.3.1

This is the dependancy I got it from the maven repository

@jwnasambu This has worked. I downloaded the javax.xml.bind JRE and added it to the build path. The error goes away.