Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module java.xml.bind not found

Tags:

eclipse

javafx

I am new with javafx and eclipse . I installed eclipse then javafx from the eclipse market . I generated an fxml code with scene builder but I can not execute it . I m really blocked and couldnt find any soltution

I added --add-modules java.xml.bind as an argument in run configuration , but no chance

 Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.xml.bind not found
like image 706
IMAD HAMMANI Avatar asked Oct 22 '19 00:10

IMAD HAMMANI


People also ask

Is JAXB available in Java 11?

With Java releases lower than Java 11, JAXB was part of the JVM and you could use it directly without defining additional libaries. As of Java 11, JAXB is not part of the JRE anymore and you need to configure the relevant libraries via your dependency management system, for example Maven or Gradle.

Why was JAXB removed?

JAXB was integrated within the JVM itself, so you didn't need to add any code dependency to have the functionality within your application. But with the modularization performed in JDK 9, it was removed as the maintainers wanted to have a smaller JDK distribution that only contains the core concepts.

What does javax XML bind do?

Package javax. xml. bind Description. Provides a runtime binding framework for client applications including unmarshalling, marshalling, and validation capabilities.

What is javax XML bind Datatypeconverter?

It defines static parse and print methods that provide access to a JAXB provider's implementation of parse and print methods. The static methods defined in the class can also be used to specify a parse or a print method in a javaType binding declaration.


1 Answers

This has been removed from the JDK with version 11+. You have to explicitly add some external dependencies to your project.

        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>2.3.1</version>
            <scope>runtime</scope>
        </dependency>

And remove the --add-modules directive.

like image 197
mipa Avatar answered Oct 22 '22 07:10

mipa