fix: Compilation Error

This commit is contained in:
huanghongxun 2021-05-19 00:45:21 +08:00
parent 1e3a5f9515
commit f55fe0fc45
3 changed files with 5 additions and 11 deletions

View File

@ -54,10 +54,8 @@ import org.jackhuang.hmcl.util.*;
import org.jackhuang.hmcl.util.gson.UUIDTypeAdapter;
import org.jackhuang.hmcl.util.i18n.I18n;
import org.jackhuang.hmcl.util.io.ResponseCodeException;
import org.jackhuang.hmcl.util.platform.CommandBuilder;
import org.jackhuang.hmcl.util.platform.*;
import org.jackhuang.hmcl.util.platform.JavaVersion;
import org.jackhuang.hmcl.util.platform.ManagedProcess;
import org.jackhuang.hmcl.util.platform.OperatingSystem;
import org.jackhuang.hmcl.util.versioning.VersionNumber;
import java.io.File;
@ -373,7 +371,7 @@ public final class LauncherHelper {
}
if (!flag && java.getPlatform() == org.jackhuang.hmcl.util.platform.Platform.BIT_32 &&
org.jackhuang.hmcl.util.platform.Platform.IS_64_BIT) {
Architecture.CURRENT.getPlatform() == org.jackhuang.hmcl.util.platform.Platform.BIT_64) {
final JavaVersion java32 = java;
// First find if same java version but whose platform is 64-bit installed.

View File

@ -18,6 +18,7 @@
package org.jackhuang.hmcl.game;
import org.jackhuang.hmcl.util.Lang;
import org.jackhuang.hmcl.util.platform.Architecture;
import org.jackhuang.hmcl.util.platform.OperatingSystem;
import java.util.regex.Pattern;
@ -71,7 +72,7 @@ public final class OSRestriction {
return false;
if (arch != null)
return !Lang.test(() -> !Pattern.compile(arch).matcher(OperatingSystem.SYSTEM_ARCHITECTURE).matches());
return !Lang.test(() -> !Pattern.compile(arch).matcher(Architecture.SYSTEM_ARCHITECTURE).matches());
return true;
}

View File

@ -44,15 +44,10 @@ public enum Platform {
return bit;
}
/**
* True if current Java Environment is 64-bit.
*/
public static final boolean IS_64_BIT = OperatingSystem.SYSTEM_ARCHITECTURE.contains("64");
/**
* The platform of current Java Environment.
*/
public static final Platform PLATFORM = IS_64_BIT ? BIT_64 : BIT_32;
public static final Platform PLATFORM = Architecture.CURRENT.getPlatform();
/**
* The json serializer to {@link Platform}.