Java tutorial
//package com.java2s; public class Main { public static boolean isMacOSHost() { return checkHostOS("mac"); } /** * Checks if host operational system matches given operational system name. * @param osName the operational system name * @return <b><i>true</b></i> if host operational system matches given name, <b><i>false</b></i> otherwise. */ private static boolean checkHostOS(String osName) { return System.getProperty("os.name").toLowerCase().contains(osName); } }