Skip to content

Commit 1654c65

Browse files
authored
[release/3.6] 在 ./.hmcl/java 中搜索 Java (#4434)
#4179
1 parent 881f5e7 commit 1654c65

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

HMCL/src/main/java/org/jackhuang/hmcl/java/JavaManager.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ private JavaManager() {
5656
}
5757

5858
public static final HMCLJavaRepository REPOSITORY = new HMCLJavaRepository(Metadata.HMCL_GLOBAL_DIRECTORY.resolve("java"));
59+
public static final HMCLJavaRepository LOCAL_REPOSITORY = new HMCLJavaRepository(Metadata.HMCL_CURRENT_DIRECTORY.resolve("java"));
5960

6061
public static String getMojangJavaPlatform(Platform platform) {
6162
if (platform.getOperatingSystem() == OperatingSystem.WINDOWS) {
@@ -561,6 +562,10 @@ private static void searchAllJavaInRepository(Map<Path, JavaRuntime> javaRuntime
561562
for (JavaRuntime java : REPOSITORY.getAllJava(platform)) {
562563
javaRuntimes.put(java.getBinary(), java);
563564
}
565+
566+
for (JavaRuntime java : LOCAL_REPOSITORY.getAllJava(platform)) {
567+
javaRuntimes.put(java.getBinary(), java);
568+
}
564569
}
565570

566571
private static void searchAllOfficialJava(Map<Path, JavaRuntime> javaRuntimes, Path directory, boolean verify) {

0 commit comments

Comments
 (0)