searoute
searoute copied to clipboard
maven-war-plugin v2.3 incompatible with JDK 16+
Using a JDK v16+ to build the war file produces the following error.
pushd modules/war
mvn package
ExceptionInInitializerError: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module...
The war file builds successfully if JDK v11 through v15 is used.
Suggested fix, one of:
- A: Update the maven-war-plugin version (might break compatibility with other JDKs)
- B: Set the JDK version in the POM file to one of JDK v11 - v15 (I haven't tested this)
- C: Update the documentation to instruct the user to build with one of JDK v11 - v15
Please let me know what you prefer, and I'll create a PR.