Determine operating system using System class in Java
Description
The following code shows how to determine operating system using System class.
Example
//from www. j a v a 2 s .c om
public class Main {
public static void main(String[] args) {
System.out.println(System.getProperty("os.name"));
}
}
The code above generates the following result.