To make most of the modularization, we should start with creating our own module:
- 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).
- Unfortunately, jdeps missed one more thing, which we need to add manually:
opens chapterEleven to javafx.fxml;
This line is ...