Original address: Click on the Open link
String OS = System.getproperty ("Os.name");
if (Os.tolowercase (). StartsWith ("Win")) {
System.out.println (OS + "can ' t gunzip");
}
System class
public static Properties getProperties()
Returns the current set of system properties that the GetProperty (String) method uses as a Properties object
Description of key-related values
| Java.version |
Java Runtime Environment version |
| Java.vendor |
Java Runtime Environment Vendor |
| Java.vendor.url |
URLs for Java Vendors |
| Java.home |
Java installation directory |
| Java.vm.specification.version |
Java Virtual Machine Spec 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 |
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 |
Path to one or more extended directories |
| Os.name |
The name of the operating system |
| Os.arch |
The architecture of the operating system |
| Os.version |
Version of the operating system |
| File.separator |
File delimiter (in UNIX system is "/") |
| Path.separator |
Path separator (in UNIX system is ":") |
| Line.separator |
Row 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 |