Java tutorial
//package com.java2s; public class Main { public static final int getOSType() { if (System.getProperty("os.name").trim().toLowerCase().contains("windows")) return 0; if (System.getProperty("os.name").trim().toLowerCase().contains("mac")) { return 1; } return -1; } }