Error: Could not find or load main class com.sun.tools.internal.xjc.XJCFacade

11.8k Views Asked by At

i'm running eclipse luna with jdk 8 and i tried generating jaxb classes and this error kept showing, i tried multiple solutions found on internet but nothing really worked with me ps : i'm pointing jdk 8 not the jre. please help!

3

There are 3 best solutions below

1
Anant On

Please try pointing the 'installed JRE' to JDK in eclipse->windows->preferences->installed JRE

Hope it helps you.

0
Hany Kamal On

Or you need to add the following dependency in your pom.xml file

<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-xjc</artifactId>
    <version>${jaxb-xjc.version}</version>
</dependency>
0
Ramigani Purushothamreddy On

** 1 . add below dependency**

  <dependency>
        <groupId>org.glassfish.jaxb</groupId>
        <artifactId>jaxb-xjc</artifactId>
        <version>3.0.0</version>
    </dependency>

** 2 . Then right click on the filename.xsd ->new ->Jaxb -> jaxB classes from schema >> then click next

specify the location where do you want to generate classes

-> then click finish