Class OSInfo

java.lang.Object
org.jline.nativ.OSInfo

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

  • Method Details

    • main

      public static void main(String[] args)
    • getNativeLibFolderPathForCurrentOS

      public static String getNativeLibFolderPathForCurrentOS()
    • getOSName

      public static 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 String getArchName()