[FEATURE] Вывод отладки в поиске Java

This commit is contained in:
Gravit 2020-06-17 15:54:23 +07:00
parent 3e6384cad9
commit 926e1534af
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -189,6 +189,7 @@ public static boolean tryAddModule(Path[] paths, String moduleName, StringBuilde
public static JavaVersion findJavaByProgramFiles(Path path) public static JavaVersion findJavaByProgramFiles(Path path)
{ {
LogHelper.debug("Check Java in %s", path.toString());
JavaVersion selectedJava = null; JavaVersion selectedJava = null;
File[] candidates = path.toFile().listFiles(File::isDirectory); File[] candidates = path.toFile().listFiles(File::isDirectory);
if(candidates == null) return null; if(candidates == null) return null;
@ -198,6 +199,7 @@ public static JavaVersion findJavaByProgramFiles(Path path)
try { try {
JavaVersion javaVersion = JavaVersion.getByPath(javaPath); JavaVersion javaVersion = JavaVersion.getByPath(javaPath);
if(javaVersion == null || javaVersion.version < 8) continue; if(javaVersion == null || javaVersion.version < 8) continue;
LogHelper.debug("Found Java %d in %s (javafx %s)", javaVersion.version, javaVersion.jvmDir.toString(), javaVersion.enabledJavaFX ? "true" : "false");
if(javaVersion.enabledJavaFX && (selectedJava == null || !selectedJava.enabledJavaFX)) if(javaVersion.enabledJavaFX && (selectedJava == null || !selectedJava.enabledJavaFX))
{ {
selectedJava = javaVersion; selectedJava = javaVersion;
@ -211,6 +213,10 @@ public static JavaVersion findJavaByProgramFiles(Path path)
LogHelper.error(e); LogHelper.error(e);
} }
} }
if(selectedJava != null)
{
LogHelper.debug("Selected Java %d in %s (javafx %s)", selectedJava.version, selectedJava.jvmDir.toString(), selectedJava.enabledJavaFX ? "true" : "false");
}
return selectedJava; return selectedJava;
} }