I see these: test-nio: [junit] Unrecognized option: --add-opens=java.base/java.lang=ALL-UNNAMED [junit] Error: Could not create the Java Virtual Machine. [junit] Error: A fatal exception has occurred. Program will exit. [junit] Running javax.el.TestArrayELResolver [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec [junit] Test javax.el.TestArrayELResolver FAILED (crashed) [junit] Unrecognized option: --add-opens=java.base/java.lang=ALL-UNNAMED [junit] Error: Could not create the Java Virtual Machine. [junit] Error: A fatal exception has occurred. Program will exit. [junit] Running javax.el.TestBeanELResolver [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec -- $ java -version java version "1.8.0_331" Java(TM) SE Runtime Environment (build 1.8.0_331-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.331-b09, mixed mode)
It should suffice to add the following lines to your own build.properties file: opens.javalang=-Dnop opens.javaio=-Dnop opens.sunrmi=-Dnop opens.javautil=-Dnop opens.javautilconcurrent=-Dnop You can add them before building or also just before running the test. They only apply to the unit test runs. The "nop" was chosen as any system property name that is likely not actually being used. It should remind one of a "no-operation". The project switched to using JDK 11 during build (but the resulting TC 8.5 still runs on Java 7). Those switches above were introduced to still allow testing for older JDKs to ensure compatibility. For testing with JDK 7 a few more adjustments are needed. We should probably document this. Regards, Rainer
Tomcat 8.5.x now requires Java 11 to build. Minimum runtime version remains Java 7. See BUILDING.txt in the root of the distribution. It does appear that building.html needs to updated for all versions.
Aha. Thank you! I see it now: https://github.com/apache/tomcat/commit/3b68fa6a4632592086cb9dc20118130cc7b9d16e https://github.com/apache/tomcat/commit/1912714307925c82b1ee015d7644bba044acf1f9 With the workaround added into build.properties file I'm running unit testing now. But still I used JDK 8 for the build without any problem. Is JDK 11 for the build really hard requirement now?
The expectation is that Tomcat will be built with (at least) Java 11. It will probably remain possible to build with Java 8 but at some point that might no longer be the case.
FWIW, all my Tomcat 8.5.x release testing is done by building-from-source with a Java 1.8 JVM and toolchain (and I'm the current release-manager for Tomcat 8.5.x). I use the exact technique Rainer detailed in comment #1. I have a loose commitment to ensure Tomcat 8.5.x will be buildable by Java 1.8
I've updated building.html for the next round of releases. Fixed in: - 10.1.x for 10.1.0-M16 onwards - 10.0.x for 10.0.22 onwards - 9.0.x for 9.0.64 onwards - 8.5.x for 8.5.80 onwards