From 3b184ff51811b97def4ce0e263a0f2c26dae63c9 Mon Sep 17 00:00:00 2001 From: Besmir Beqiri Date: Tue, 19 Mar 2024 17:00:13 +0100 Subject: [PATCH] Provide a method to check if the current operating system architecture is `aarch64` --- .../one/jpro/platform/internal/util/PlatformUtils.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/util/src/main/java/one/jpro/platform/internal/util/PlatformUtils.java b/internal/util/src/main/java/one/jpro/platform/internal/util/PlatformUtils.java index e5bf9c75..e62989cf 100644 --- a/internal/util/src/main/java/one/jpro/platform/internal/util/PlatformUtils.java +++ b/internal/util/src/main/java/one/jpro/platform/internal/util/PlatformUtils.java @@ -9,6 +9,7 @@ public class PlatformUtils { private static final String os = System.getProperty("os.name"); private static final String version = System.getProperty("os.version"); + private static final String arch = System.getProperty("os.arch"); private static final String javafxPlatform = System.getProperty("javafx.platform"); private static final boolean embedded = Boolean.getBoolean("com.sun.javafx.isEmbedded"); private static final boolean ANDROID = "android".equals(javafxPlatform) || "Dalvik".equals(System.getProperty("java.vm.name")); @@ -80,6 +81,15 @@ public static boolean isIOS(){ return IOS; } + /** + * Returns true if the operating system architecture is arm64 (aarch64). + * + * @return true if the operating system architecture is arm64, false otherwise. + */ + public static boolean isAarch64() { + return arch.equals("aarch64"); + } + /** * Utility method used to determine whether the version number as * reported by system properties is greater than or equal to a given