0

Hi i am doing some school project on java and I am required to do Java Doc but whenever I tried to generate through eclipse.

error: package javax.xml.bind does not exist import javax.xml.bind.DatatypeConverter; ^ error: package javax.xml.bind does not exist import javax.xml.bind.DatatypeConverter;

These error appear. Can someone help me out? Thanks in advance.

1 Answers1

0

What JDK version are you using?

If you are using 11+ then it could be because java.xml.bind package was removed in Java 11.

Try to add the following dependency to your POM.xml (or build.gradle):

<dependency>
  <groupId>jakarta.xml.bind</groupId>
  <artifactId>jakarta.xml.bind-api</artifactId>
  <version>2.3.3</version>
</dependency>

Either try to downgrade your java version

  • Stepess , Where is that ?? i could not find it. – Yogesh Bhattarai Apr 29 '20 at 12:57
  • @UniqueBhattarai, Do you use a build tool in your project? Like `maven` or `gradle`? – Stepess Apr 29 '20 at 13:23
  • and could you please attach the output of `java --version` command? – Stepess Apr 29 '20 at 13:28
  • no i am using the java doc for my academic project and I am using java swing – Yogesh Bhattarai Apr 29 '20 at 13:40
  • @UniqueBhattarai, and what about JDK version? Afaik, all version from 10 and down should work, but better to use 8 if it is not critical – Stepess Apr 29 '20 at 14:45
  • ava version "1.8.0_202" Java(TM) SE Runtime Environment (build 1.8.0_202-b08) Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode) – Yogesh Bhattarai Apr 29 '20 at 14:45
  • @UniqueBhattarai, I'm not a big expert in Eclipse, but I suppose that something could wrong on that side. You can try to generate `javadoc` using the [command line](https://stackoverflow.com/questions/4592396/how-to-generate-javadoc-from-command-line) – Stepess Apr 29 '20 at 15:44