does not nessary invoke method findJavaHome() twice (#1666)

pull/1675/head
guaidaokakaxi 4 years ago committed by GitHub
parent dd48b2b433
commit a87f29842e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -233,7 +233,7 @@ public class ProcessUtils {
String javaHome = findJavaHome();
// find java/java.exe
File javaPath = findJava();
File javaPath = findJava(javaHome);
if (javaPath == null) {
throw new IllegalArgumentException(
"Can not find java/java.exe executable file under java home: " + javaHome);
@ -354,8 +354,7 @@ public class ProcessUtils {
}
}
private static File findJava() {
String javaHome = findJavaHome();
private static File findJava(String javaHome) {
String[] paths = { "bin/java", "bin/java.exe", "../bin/java", "../bin/java.exe" };
List<File> javaList = new ArrayList<File>();

Loading…
Cancel
Save