Java JVM is 64 Bit is64BitJavaOnMac()

Here you can find the source of is64BitJavaOnMac()

Description

True if this JVM is running 64 bit Java on a Mac.

License

Apache License

Return

true if this JVM is running 64 bit Java on a Mac.

Declaration

public static boolean is64BitJavaOnMac() 

Method Source Code

//package com.java2s;
/*/*w w w  .  j  av  a  2  s . co m*/
 * Copyright (c) 2009 Kathryn Huxtable and Kenneth Orr.
 *
 * This file is part of the SeaGlass Pluggable Look and Feel.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * $Id$
 */

public class Main {
    private static final String SEA_GLASS_OVERRIDE_OS_NAME = "SeaGlass.Override.os.name";

    /**
     * True if this JVM is running 64 bit Java on a Mac.
     *
     * @return true if this JVM is running 64 bit Java on a Mac.
     */
    public static boolean is64BitJavaOnMac() {
        return isMac() && System.getProperty("os.arch").equals("x86_64");
    }

    /**
     * True if this JVM is running on a Mac.
     *
     * @return true if this JVM is running on a Mac.
     */
    public static boolean isMac() {
        if (System.getProperty(SEA_GLASS_OVERRIDE_OS_NAME) != null) {
            return System.getProperty(SEA_GLASS_OVERRIDE_OS_NAME)
                    .startsWith("Mac OS");
        }

        return System.getProperty("os.name").startsWith("Mac OS");
    }
}

Related

  1. is64Bit()
  2. is64Bit()
  3. is64Bit()
  4. is64Bit()
  5. is64BitJavaOnMac()
  6. is64BitJre()
  7. is64bitJVM()
  8. is64BitJVM()
  9. is64BitJVM()