is Mac OS - Java Native OS

Java examples for Native OS:OS

Description

is Mac OS

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        System.out.println(isMac());
    }//from   w ww.j ava 2  s . c  o  m

    private static String CURRENT_OS = System.getProperty("os.name")
            .toLowerCase();

    private static boolean isMac() {

        return (CURRENT_OS.indexOf("mac") >= 0);

    }
}

Related Tutorials