Using System.getproperties (Java.os.name)
Parameters can also be os.arch, os.version
Here are some more:
Returns the current set of system properties used by the GetProperty (String) method as a Properties object. If there is no collection of current system properties, a collection of system properties is created and initialized first. This collection of system attributes always contains the value of the following key: A description of the key correlation value
Java.version Java Runtime Environment version
Java.vendor Java Runtime Environment Vendor
Java.vendor.url Java Vendor's URL
Java.home Java installation directory
Java.vm.specification.version Java Virtual Machine specification version
Java.vm.specification.vendor Java virtual Machine specification Vendor
Java.vm.specification.name Java Virtual Machine Specification Name
Java.vm.version Java Virtual Machine implementation version
Java.vm.vendor Java virtual Machine implementation Provider
Java.vm.name Java virtual Machine implementation name
Java.specification.version Java Runtime Environment specification version
Java.specification.vendor Java Runtime Environment specification vendor
Java.specification.name Java Runtime Environment Specification name
Java.class.version Java class format version number
Java.class.path Java class Path
Java.library.path the list of paths to search when loading libraries
Java.io.tmpdir Default Temporary file path
Java.compiler the name of the JIT compiler to use
Java.ext.dirs the path of one or more extended directories
Os.name the name of the operating system
Architecture of the Os.arch operating system
Os.version version of the operating system
File.separator file Separator (in UNIX system is "/")
Path.separator path Separator (in UNIX system is ":")
Line.separator line delimiter (in UNIX system is "n")
User.Name User's account name
User.home User's home directory
User.dir User's current working directory