There are two ways how to find Java binary currently in the library. java.home and JAVA_HOME.
JAVA_HOME is system environment variable
java.home is property of JVM pointing to Java version that current JVM is using
Currently, the location is taken from JAVA_HOME and only if it's not there (and that will rarely happen) it's taken from java.home.
I suggest that java.homeshould be the default
Some reasons why I think it should be the case:
surefire is also using java.home
running mvn from Intelij Idea will not set the JAVA_HOME so the test will not use the jvm set for the project (but java.home is set)
running on teamcity same problem as with Idea
Basically main problem that can happen is that I run the build under Java 8, but suddenly scalatest switches to Java 11 because it's used by my system.
If there is a need to run scalatest under different java then the rest of the bild there should be special flag for that. (But why anyone would like to do that?)
There are two ways how to find Java binary currently in the library.
java.home
andJAVA_HOME
.JAVA_HOME
is system environment variablejava.home
is property of JVM pointing to Java version that current JVM is usingCurrently, the location is taken from
JAVA_HOME
and only if it's not there (and that will rarely happen) it's taken fromjava.home
.I suggest that
java.home
should be the defaultSome reasons why I think it should be the case:
java.home
JAVA_HOME
so the test will not use the jvm set for the project (butjava.home
is set)Basically main problem that can happen is that I run the build under Java 8, but suddenly scalatest switches to Java 11 because it's used by my system.
If there is a need to run scalatest under different java then the rest of the bild there should be special flag for that. (But why anyone would like to do that?)