Affected version
3.5.4
Bug description
Surefire adds the --add-opens option, which is not supported by Java 8, to the Java command when Java 9 or later is used as the JAVA_HOME directory.
Command was cmd.exe /X /C ""C:\Program Files\Java\openjdk\j9\jdk8u472-b08\bin\java.exe" --add-opens java.base/java.lang=ALL-UNNAMED --enable-native-access=ALL-UNNAMED ....
When using JDK 8 as the JAVA_HOME directory, everything works fine because the --add-opens option is not used.