-
Couldn't load subscription status.
- Fork 61
Description
With forkMode set to once or always new processes are forked to execute the tests. They start java using the command java, but in the maven ecosystem one would expect the forked processes to use $JAVA_HOME/bin/java instead. This would ensure that the same java version is used as for the build as for the test execution.
You can see the following line in your maven output when run with -X option (values in ??? are replaced with what they represent)
[14:07:24][???groupdId:artifactId???] [DEBUG] Forking ScalaTest via: /bin/sh -c cd ???basedir??? && java -Dbasedir=???basedir??? org.scalatest.tools.Runner -R '???basedir???/target/classes ???basedir???/target/test-classes' -o -u ???basedir???/target/surefire-reports/
but would expect the following
[14:07:24][???groupdId:artifactId???] [DEBUG] Forking ScalaTest via: /bin/sh -c cd ???basedir??? && $JAVA_HOME/bin/java -Dbasedir=???basedir??? org.scalatest.tools.Runner -R '???basedir???/target/classes ???basedir???/target/test-classes' -o -u ???basedir???/target/surefire-reports/
A typical symptom of this is the following error message:
Unsupported major.minor version 52.0
This happens if your java code is compiled with Java 8 and then executed with Java <8. Other combinations of Java versions will lead to slightly different error messages.