Class OSInfo


  • public class OSInfo
    extends java.lang.Object
    Provides OS name and architecture name.
    Author:
    leo
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ARM64  
      static java.lang.String IA64  
      static java.lang.String IA64_32  
      static java.lang.String PPC  
      static java.lang.String PPC64  
      static java.lang.String X86  
      static java.lang.String X86_64  
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
      • getNativeLibFolderPathForCurrentOS

        public static java.lang.String getNativeLibFolderPathForCurrentOS()
      • getOSName

        public static java.lang.String getOSName()
      • isAndroid

        public static boolean isAndroid()
      • isMusl

        public static boolean isMusl()
        Detects whether the current process is using musl libc (e.g. on Alpine Linux).

        First checks /proc/self/maps to see if the process has musl's dynamic linker loaded ? this is the most reliable method as it detects the libc the current JVM is actually linked against, even on systems where both glibc and musl are installed. Falls back to checking for /lib/ld-musl-* when procfs is unavailable.

      • isAlpine

        @Deprecated
        public static boolean isAlpine()
        Deprecated.
        Use isMusl() instead, which correctly detects all musl-based systems.
        Detects whether the current system is Alpine Linux.
      • getArchName

        public static java.lang.String getArchName()