fix ExceptionInInitializerError

This commit is contained in:
Glavo
2021-09-04 13:21:55 +08:00
parent 5310de88d5
commit d77a09042d
6 changed files with 8 additions and 7 deletions

View File

@@ -94,7 +94,7 @@ public class Library implements Comparable<Library>, Validation {
public String getClassifier() {
if (artifact.getClassifier() == null)
if (natives != null && natives.containsKey(OperatingSystem.CURRENT_OS))
return natives.get(OperatingSystem.CURRENT_OS).replace("${arch}", Platform.PLATFORM.getBit());
return natives.get(OperatingSystem.CURRENT_OS).replace("${arch}", Platform.getPlatform().getBit());
else
return null;
else

View File

@@ -165,7 +165,7 @@ public final class JavaVersion {
CURRENT_JAVA = new JavaVersion(
currentExecutable,
System.getProperty("java.version"),
Platform.PLATFORM);
Platform.getPlatform());
}
private static Collection<JavaVersion> JAVAS;

View File

@@ -47,7 +47,9 @@ public enum Platform {
/**
* The platform of current Java Environment.
*/
public static final Platform PLATFORM = Architecture.CURRENT.getPlatform();
public static Platform getPlatform() {
return Architecture.CURRENT.getPlatform();
}
/**
* The json serializer to {@link Platform}.