Closed
Description
I am running a Tycho build using 2.7.0 on Windows. Even with a JAVA_HOME environment variable set, the tycho log shows this.
"Could not find the Toolchain nor JAVA_HOME, trying java from PATH instead"
Looking into the AbstractTestMojo I can see this on line 1237:
File file = new File(javaHome, "bin/java");
Afterwards it is checked if the file exists, otherwise the message will be shown and Java will be resolved from the PATH.
On Windows the filename is java.exe
A possible solution would be to do an OS check to determine the filename:
String osName = System.getProperty("os.name");
String executable = osName.startsWith("Windows") ? "bin/java.exe" : "bin/java";
File file = new File(javaHome, executable);
Not sure if there is a more elegant or efficient way.