I have a weird problem with an import I'm using in an Eclipse project. I am importing javax.xml.bind but I have an error saying that it cannot be resolved. My project's compliance is using Java 1.8, my JRE System Library is also 1.8. A friend of mine that is working on the code with me through Github has the same Java configurations in Eclipse but he is not having the same problem as I do. We have tried uninstalling and re installing the JRE for the project and still won't work. Does anyone know what's this all about?
Asked
Active
Viewed 1.7k times
2 Answers
11
You might have configured a newer Java JDK/JRE (where javax.xml.bind
is missing) in Window > Preferences: Java > Installed JREs.
Since Java 11 javax.xml.bind
is not contained anymore in the system library and has to be added as a dependency (e.g. with this one).

howlger
- 31,050
- 11
- 59
- 99
-
-
4@Jon Since Java 11 `javax.xml.bind` is not contained anymore in the system library and has to be added as dependency (e.g. [with this one](https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api)). – howlger Jan 17 '21 at 14:44
-
1
I'm working with Java 17. As mentioned javax.xml.bind
is missing in newer JDKs.
Step 1: Go to this link .
Step 2: Select one of the Versions
Step 3: Copy the contents of dependency tag under Maven tab.
Step 4: Add the copied contents in pom.xml file within <dependencies> </dependencies>
tags
Now you should be able to see an option to import required libraries.

Shubhasmita Roy
- 39
- 1
- 7