diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/download/java/JavaRepository.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/download/java/JavaRepository.java index 688fd84d2..45116bf6b 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/download/java/JavaRepository.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/download/java/JavaRepository.java @@ -72,10 +72,16 @@ public final class JavaRepository { return Optional.of("mac-os"); } } else if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) { - if (Architecture.SYSTEM_ARCH == Architecture.X86 || Architecture.SYSTEM_ARCH == Architecture.ARM64) { + if (Architecture.SYSTEM_ARCH == Architecture.X86) { return Optional.of("windows-x86"); } else if (Architecture.SYSTEM_ARCH == Architecture.X86_64) { return Optional.of("windows-x64"); + } else if (Architecture.SYSTEM_ARCH == Architecture.ARM64) { + if (OperatingSystem.SYSTEM_BUILD_NUMBER >= 21277) { + return Optional.of("windows-x64"); + } else { + return Optional.of("windows-x86"); + } } } return Optional.empty(); diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/JavaVersionConstraint.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/JavaVersionConstraint.java index 52c393c17..07c303c12 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/JavaVersionConstraint.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/JavaVersionConstraint.java @@ -174,7 +174,7 @@ public enum JavaVersionConstraint { JavaVersion suggested = null; for (JavaVersion javaVersion : JavaVersion.getJavas()) { // select the latest x86 java that this version accepts. - if(!javaVersion.getArchitecture().isX86()) + if (!javaVersion.getArchitecture().isX86()) continue; VersionNumber javaVersionNumber = javaVersion.getVersionNumber(); diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java index dab7a9dc3..a00f5138b 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java @@ -17,9 +17,6 @@ */ package org.jackhuang.hmcl.util.platform; -import org.jackhuang.hmcl.util.versioning.VersionNumber; -import org.jetbrains.annotations.Nullable; - import java.io.BufferedReader; import java.io.File; import java.io.IOException; @@ -31,7 +28,6 @@ import java.nio.file.Paths; import java.util.Arrays; import java.util.Locale; import java.util.Optional; -import java.util.OptionalInt; import java.util.regex.Matcher; import java.util.regex.Pattern;