1String os = System.getProperty("os.name").toLowerCase();
2if (os.contains("win")){
3 //Operating system is based on Windows
4}
5else if (os.contains("osx")){
6 //Operating system is Apple OSX based
7}
8else if (os.contains("nix") || os.contains("aix") || os.contains("nux")){
9 //Operating system is based on Linux/Unix/*AIX
10}