[FIX] Check openjdk 8 on linux (#632)

* Correct check 8 openjdk on linux

* JRE rt lib in jre/lib/rt.jar

* [fix] remove dev log
This commit is contained in:
Tenebrius 2023-01-10 16:14:47 +05:00 committed by GitHub
parent a0ac58f0b5
commit f71444b8d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -250,7 +250,7 @@ public static JavaVersion getByPath(Path jvmDir) throws IOException {
arch = null;
}
} else {
versionAndBuild = new JavaVersionAndBuild(isExistExtJavaLibrary(jvmDir, "jfxrt") ? 8 : 9, 0);
versionAndBuild = new JavaVersionAndBuild(isExistExtJavaLibrary(jvmDir, "rt") ? 8 : 9, 0);
}
JavaVersion resultJavaVersion = new JavaVersion(jvmDir, versionAndBuild.version, versionAndBuild.build, arch, false);
if (versionAndBuild.version <= 8) {
@ -265,8 +265,10 @@ 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 jrePathLin = jvmDir.resolve("lib").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) || IOHelper.isFile(jrePathLin);
}
}
}