0

I have a larger Java project separated into different maven modules, based on Spring Boot and JavaFX that compiled fine on Java 8. I thought it is about time to make the switch to a newer version and decided for version 11. As it turns out I found a number of web pages and movies, but most of them explain how to setup a new project or they must miss something, because if I applied the proposed changes it didn't work. Hence I turned many different screws and made eventually good progress, but I don't know what was actually necessary to got so far and what is not needed. Anyway, the compiler found most of the JavaFX classes, but some cannot be resolved: HTMLEditor, TableHeaderRow, TableViewSkin, WebView and a few more. I assume the root cause are missing dependencies in the parent-pom?! I do have

<dependency>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-fxml</artifactId>
    <version>11</version>
</dependency>

<dependency>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-controls</artifactId>
    <version>11</version>
</dependency>

What dependencies are missing and where can I find which dependency maps which JavaFX class?

I have not created any module-info.java so far - because I couldn't find out how to to do this if the project already exists and I saw that some where adding parameters when starting a JavFX application. If this is needed as well I would be grateful for any advice.

Alex
  • 1,387
  • 2
  • 9
  • 14
  • `HTMLEditor` and `WebView` are in a separate module, `javafx.web`, so you need to add a dependency in your pom.xml for `javafx-web` and explicitly add that module in your runtime parameters. `TableHeaderRow` and `TableViewSkin` were not public API classes in JavaFX 8, so if you were using those you did so at the peril of your application not being compatible with future releases. They *are* now public API and are in `javafx.scene.control.skin` (though there's no guarantee any methods you were calling are still available). For more, see https://stackoverflow.com/questions/52144931/ – James_D Jun 12 '20 at 12:37
  • See the link above, particularly the runtime jvm options – James_D Jun 12 '20 at 22:29
  • Thank you! The code compiles now. However, I still can't run the application because of: Error: JavaFX runtime components are missing, and are required to run this application. I still try to make sense out of the link you provided. I'll post a new question if I can't make it work. How to flag that you provided the right answer? – Alex Jun 12 '20 at 22:57

0 Answers0