mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FEATURE] Вывод отладки в поиске Java
This commit is contained in:
parent
3e6384cad9
commit
926e1534af
1 changed files with 6 additions and 0 deletions
|
@ -189,6 +189,7 @@ public static boolean tryAddModule(Path[] paths, String moduleName, StringBuilde
|
|||
|
||||
public static JavaVersion findJavaByProgramFiles(Path path)
|
||||
{
|
||||
LogHelper.debug("Check Java in %s", path.toString());
|
||||
JavaVersion selectedJava = null;
|
||||
File[] candidates = path.toFile().listFiles(File::isDirectory);
|
||||
if(candidates == null) return null;
|
||||
|
@ -198,6 +199,7 @@ public static JavaVersion findJavaByProgramFiles(Path path)
|
|||
try {
|
||||
JavaVersion javaVersion = JavaVersion.getByPath(javaPath);
|
||||
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))
|
||||
{
|
||||
selectedJava = javaVersion;
|
||||
|
@ -211,6 +213,10 @@ public static JavaVersion findJavaByProgramFiles(Path path)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue