Dave's Brain

Browse - Programming Tips - How can I see if I am running on a 32- or 64- bit system?

Date: 2016sep15
Language: Java

Q.  How can I see if I am running on a 32- or 64- bit system?

A.  These function do the trick:

// Helper String getArch() { return System.getProperty("os.arch"); } boolean is32bit() { // There is also "x86_64" which is 64-bit return getArch().equalsIgnoreCase("x86"); } boolean is64bit() { // Finds "amd64" or "x86_64" return getArch().contains("64"); }

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.