5

I have the following line of code

import javax.xml.bind.DatatypeConverter;

which is giving me a

javax.xml.bind cannot be resolved

where can I find the library file for this import?

Xavier Guihot
  • 54,987
  • 21
  • 291
  • 190
Ted pottel
  • 6,869
  • 21
  • 75
  • 134

2 Answers2

5

The module javax.xml.bind has been renamed and is also deprecated as of Java 9.

To workaround you can add --add-modules java.xml.bind to javac compilation. As suggested here

Or switch back to Java 8 or older

Maciej Pulikowski
  • 2,457
  • 3
  • 15
  • 34
2

If you have a maven build, add the following to your pom.xml

    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
    </dependency>
Anurag Bhalekar
  • 830
  • 7
  • 9