Usage

Boolean checks
OS.aix
OS.freeBSD
OS.hpux
OS.linux
OS.macOsX
OS.netBSD
OS.solaris
OS.windows
Operating system properties
OS.name (1)
OS.version (2)
OS.homeVar (3)
OS.pathVar (4)
OS.pathSeparator (5)
OS.arch (6)
OS.archStr (7)
OS.sharedLibrarySuffix (8)
OS.staticLibrarySuffix (9)
OS.operatingSystemAttributeValue (10)
OS.machineArchitectureAttributeValue (11)
1 Short operating system name
2 Descriptive version of operating system
3 The name of the environment variable that holds the home directory.
4 The name of the environment variable that holds the search path
5 The character that separates items in a search path
6 The architecture as an enumeration.
7 The architecture as an string.
8 The extension for shared libraries.
9 The extension for static libraries.
10 A string that can be passed when creating an OperatingSystemFamily e.g. objects.named(OperatingSystemFamily.class, OS.getOperatingSystemAttributeValue()).
11 A string that can be passed when creating a MachineArchitecture e.g. objects.named(MachineArchiteture.class, OS.MachineArchitectureAttributeValue()).
Methods
OS.getPath() (1)
OS.findInPath('mycmd') (2)
OS.findAllInPath('mycmd') (3)
OS.getExecutableNames('mycmd') (4)
OS.getSharedLibraryName('mylib') (5)
OS.getStaticLibraryName('mylib') (6)
1 List of system path entries a File instances.
2 Searches the system path for the first occurence of the specified file. Command will be decorated based on OS. For the above example, on Windows, mycmd.exe, mycmd.bat etc. will also be searched for.
3 Like the previous, but returns all occurrences.
4 Returns all the possible execution names for a target.
5 The full file name of a shared library.
6 The full file name of a static library.
Other operating system details
OS.getOsTypes().getAix()
OS.getOsTypes().getFreeBsd()
OS.getOsTypes().getHpUx()
OS.getOsTypes().getLinux()
OS.getOsTypes().getNetBsd()
OS.getOsTypes().getMacOsX()
OS.getOsTypes().getSolaris()
OS.getOsTypes().getWindows()
Other architectures
OS.getArchitectures()