Check whether the running VM's underlying operating operating system is Mac OS X. - Java Java Virtual Machine

Java examples for Java Virtual Machine:Version

Description

Check whether the running VM's underlying operating operating system is Mac OS X.

Demo Code

/*-/*  w  w w  .  j a  v  a  2 s. c o m*/
 * Copyright (C) 2006-2014 Erik Larsson
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
//package com.java2s;

public class Main {
    /**
     * Check whether the running VM's underlying operating operating system is
     * Mac OS X.
     *
     * @return <code>true</code> if the operating system is Mac OS X,
     * <code>false</code> otherwise.
     */
    public static boolean isMacOSX() {
        return System.getProperty("os.name").toLowerCase()
                .startsWith("mac os x");
    }
}

Related Tutorials