Skip to content

Commit

Permalink
Close #3209: 搜索 IntelliJ IDEA 安装的 Java (#3316)
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavo authored Oct 8, 2024
1 parent 9196bda commit 7492670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions HMCL/src/main/java/org/jackhuang/hmcl/java/JavaManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ private static Map<Path, JavaRuntime> searchPotentialJavaExecutables() {
FileUtils.tryGetPath(Lang.requireNonNullElse(System.getenv("ProgramFiles(x86)"), "C:\\Program Files (x86)"), "Minecraft Launcher\\runtime")
.ifPresent(it -> searchAllOfficialJava(javaRuntimes, it, false));
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX && Architecture.SYSTEM_ARCH == Architecture.X86_64) {
searchAllOfficialJava(javaRuntimes, Paths.get(System.getProperty("user.home")).resolve(".minecraft/runtime"), false);
searchAllOfficialJava(javaRuntimes, Paths.get(System.getProperty("user.home"), ".minecraft/runtime"), false);
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
searchAllOfficialJava(javaRuntimes, Paths.get(System.getProperty("user.home")).resolve("Library/Application Support/minecraft/runtime"), false);
searchAllOfficialJava(javaRuntimes, Paths.get(System.getProperty("user.home"), "Library/Application Support/minecraft/runtime"), false);
}
searchAllOfficialJava(javaRuntimes, CacheRepository.getInstance().getCacheDirectory().resolve("java"), true);

Expand All @@ -430,6 +430,7 @@ private static Map<Path, JavaRuntime> searchPotentialJavaExecutables() {
}
}
}
searchAllJavaInDirectory(javaRuntimes, Paths.get(System.getProperty("user.home"), ".jdks"));

for (String javaPath : ConfigHolder.globalConfig().getUserJava()) {
try {
Expand Down
2 changes: 2 additions & 0 deletions HMCLCore/src/main/java/org/jackhuang/hmcl/java/JavaInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ public static String normalizeVendor(String vendor) {
return "IBM";
case "Eclipse Adoptium":
return "Adoptium";
case "Amazon.com Inc.":
return "Amazon";
default:
return vendor;
}
Expand Down

0 comments on commit 7492670

Please sign in to comment.