9

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
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
IMAD HAMMANI
  • 115
  • 1
  • 1
  • 4

1 Answers1

7

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.

Michael
  • 8,362
  • 6
  • 61
  • 88
mipa
  • 10,369
  • 2
  • 16
  • 35
  • 23
    This gets more complicated at every turn. – WestCoastProjects May 03 '20 at 05:53
  • 1
    Where to add this?? – Saurabh Aug 28 '20 at 14:31
  • @Saurabh, I just searched for .xml files, and within them, for one with "" tags.. The application did launch then but not past the splash :-) I just needed this to run a medical image viewer which comes along with Your X-ray images, but it turned out there is a package Aeskulap which can open DICOM files without trying to compile weasis :-D – Esmu Igors Oct 11 '20 at 17:07