Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We currently advertise that we support "JDK 8". However, the public updates of Java SE 8 for personal users will end soon [1]. JDK 11 is the next Long-Term-Support (LTS) release after JDK 8 [1]. It is better for us to keep updated with the latest release of JDK. Let's update our target JDK to version 11, with the following steps: * We use openjfx-monocle version jdk-11+26 since that is the latest version of openjfx-monocle that supports JDK 11 [2]. * We bump the target and source compatibility of Gradle to JDK11. * We update Travis and AppVoyer configs to use JDK11 as runtime environment. * We remove the add-on in Travis config because it is redundant for JDK 11 [3]. * We make it clear in the User Guide / Developer Guide that we only support JDK 11 (not JDK 8, 9, 10). [1] https://www.oracle.com/technetwork/java/java-se-support-roadmap.html [2] https://github.com/TestFX/Monocle [3] https://www.deps.co/guides/travis-ci-latest-java/ (+6 squashed commit) Squashed commit: [b47edc6] build.gradle: remove 'prism.order' property for headless task. For headless test task, 'prism.order' property is used to choose the graph renderer to use. Currently, we specify this property to be 'sw'. However, this property seems to trigger some unknown bug with JDK11. This property will cause Java Runtime Error for Windows OS including AppVoyer: # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffd95b64879, pid=1476, tid=2640 # # JRE version: OpenJDK Runtime Environment (11.0.1+13) (build 11.0.1+13) # Java VM: OpenJDK 64-Bit Server VM (11.0.1+13, mixed mode, tiered, compressed oops, g1 gc, windows-amd64) # Problematic frame: # C [javafx_font.dll+0x4879] It is more like a JDK 11 bug with 'sw' renderer. Meanwhile, it is not so necessary to set this property. It is acceptable to use platform-specified graph renderer to do the test. Let’s remove this property to solve the problem. [c8d0e8c] build.gradle: add javafx runtime dependency for other platforms We have added the platform specific javafx runtime dependency, so the addressbook is able to run locally. However, the jar file generated on one OS cannot run on other OS. The reason is that, java SE cannot initialize the graph render correctly without corresponding javafx dependency for the other OS. Let’s add the javafx runtime dependency for all platforms (MacOS, Window, Linux) so the jar file generated on one OS is able to run in other OS [1]. The order of dependency is important because it effects the way Gradle group dependency tree. [1]https://stackoverflow.com/questions/52653836/maven-shade-javafx-runtime-components-are-missing/52654791#52654791 [9f7b7be] 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. [1] http://mail.openjdk.java.net/pipermail/openjfx-dev/2018-June/021977.html [3cb5cbb] build.gradle: add javafx runtime dependency JavaFX is not distributed with Oracle JDK any more from JDK11 onwards [1]. Our code uses javafx as our client platform. So it is unable to be compiled in JDK11 anymore. As we are moving to JDK11, let’s add javafx runtime dependency to gradle. Meanwhile, the dependency provided are platform specific. Let’s use the SystemUtils api provided by Apache [2] to specify the version of javafx dependency. [1]https://blogs.oracle.com/java-platform-group/the-future-of-javafx-and-other-java-client-roadmap-updates [2]http://commons.apache.org/proper/commons-lang/javadocs/api-release/index.html [18d0cab] disable TLS v1.3 protocol We use Gradle coverall plugin to send the data generated by coverage plugin to coverall.io, so our user can view the coverage report online. However, the TLSv1.3 protocol used by JDK 11 is not supported by the coverall.io, actually it gives the error bellow: javax.net.ssl.SSLProtocolException: Connection reset by peer (Write failed) Let’s disable TLSv1.3 protocol by restricting the scope of protocols in gradle.properties.[1] [1]kt3k/coveralls-gradle-plugin#85 [f0ded52] build.gradle: fix checkstyle plugin failure The `checkstyle` plugin of Gradle fails in JDK11 and gives the error below: Unable to create Root Module: config ... The main reason is that, in JDK11, the `user.dir` cannot be reset by Gradle [1]. So, checkstyle plugin is unable to locate the suppressions file correctly. Let's add ` config_loc` variable suggested by Gradle to solve the problem [1]. [1] gradle/gradle#8286
- Loading branch information