Making our own module

To make most of the modularization, we should start with creating our own module:

  1. First, let's see which modules are used in our small applications using the jdeps tool:
        "$JAVA_HOME/bin/jdeps" --generate-module-info . dist/SimpleApp.jar

This call will generate a module-info.java file that describes our application as a module:

        module chapterEleven {            requires javafx.base;            requires javafx.controls;            requires transitive javafx.fxml;            requires transitive javafx.graphics;             exports chapterEleven;        }  

We see that our application depends on only four modules (and java.base, which is always included).

  1. Unfortunately, jdeps missed one more thing, which we need to add manually:
        opens chapterEleven to javafx.fxml;

This line is ...

Get Mastering JavaFX 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.