From 9dfb4ff323d7c2dc382947249cef3772ce4533f9 Mon Sep 17 00:00:00 2001 From: MagTemTenebrius Date: Mon, 9 Jan 2023 14:32:44 +0500 Subject: [PATCH] Correct check 8 openjdk on linux --- .../src/main/java/pro/gravit/utils/helper/JavaHelper.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java index 73be2837..77e1ce5d 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java @@ -250,7 +250,8 @@ public static JavaVersion getByPath(Path jvmDir) throws IOException { arch = null; } } else { - versionAndBuild = new JavaVersionAndBuild(isExistExtJavaLibrary(jvmDir, "jfxrt") ? 8 : 9, 0); + LogHelper.dev("TEST3: " + jvmDir + " | Version: " + isExistExtJavaLibrary(jvmDir, "rt")); + versionAndBuild = new JavaVersionAndBuild(isExistExtJavaLibrary(jvmDir, "rt") ? 8 : 9, 0); } JavaVersion resultJavaVersion = new JavaVersion(jvmDir, versionAndBuild.version, versionAndBuild.build, arch, false); if (versionAndBuild.version <= 8) { @@ -266,7 +267,8 @@ public static JavaVersion getByPath(Path jvmDir) throws IOException { public static boolean isExistExtJavaLibrary(Path jvmDir, String name) { Path jrePath = jvmDir.resolve("lib").resolve("ext").resolve(name.concat(".jar")); Path jdkPath = jvmDir.resolve("jre").resolve("lib").resolve("ext").resolve(name.concat(".jar")); - return IOHelper.isFile(jrePath) || IOHelper.isFile(jdkPath); + Path jdkPathLin = jvmDir.resolve("jre").resolve("lib").resolve(name.concat(".jar")); + return IOHelper.isFile(jrePath) || IOHelper.isFile(jdkPath) || IOHelper.isFile(jdkPathLin); } } }