- java.lang.Object
-
- org.jline.nativ.OSInfo
-
public class OSInfo extends java.lang.ObjectProvides OS name and architecture name.- Author:
- leo
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.StringgetArchName()static java.lang.StringgetNativeLibFolderPathForCurrentOS()static java.lang.StringgetOSName()static booleanisAlpine()Deprecated.UseisMusl()instead, which correctly detects all musl-based systems.static booleanisAndroid()static booleanisMusl()Detects whether the current process is using musl libc (e.g.static voidmain(java.lang.String[] args)
-
-
-
Field Detail
-
X86
public static final java.lang.String X86
- See Also:
- Constant Field Values
-
X86_64
public static final java.lang.String X86_64
- See Also:
- Constant Field Values
-
IA64_32
public static final java.lang.String IA64_32
- See Also:
- Constant Field Values
-
IA64
public static final java.lang.String IA64
- See Also:
- Constant Field Values
-
PPC
public static final java.lang.String PPC
- See Also:
- Constant Field Values
-
PPC64
public static final java.lang.String PPC64
- See Also:
- Constant Field Values
-
ARM64
public static final java.lang.String ARM64
- See Also:
- Constant Field Values
-
-
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/mapsto 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.UseisMusl()instead, which correctly detects all musl-based systems.Detects whether the current system is Alpine Linux.
-
getArchName
public static java.lang.String getArchName()
-
-