Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change the entry point of addressbook
After we add the javafx runtime dependency, addressbook is still unable to run in a jdk11 environment. It gives an error of below: Error: JavaFX runtime components are missing, and are required to run this application This error comes from sun.launcher.LauncherHelper in the java.base module. The reason for this is that the Main app extends Application and has a main method. If that is the case, the LauncherHelper will check for the javafx.graphics module to be present as a named module. If that module is not present, the launch is aborted. Hence, having the JavaFX libraries as jars on the classpath is not allowed in this case [1]. This is more like a JDK 11 problem which cannot be solved elegantly. One simple workaround is to have a separate main class that doesn't extend Application. Hence it doesn't do the check on javafx.graphics module, and when the required jars are on the classpath, it works fine. Let's add another main class to be the new entry point of addressbook to solve this problem [2]. [1] http://mail.openjdk.java.net/pipermail/openjfx-dev/2018-June/021977.html [2] https://stackoverflow.com/questions/52653836/maven-shade-javafx-runtime-components-are-missing/52654791#52654791
- Loading branch information