Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { /** * Uses the non-portable system property sun.arch.data.model to help * determine if we are running on a 32-bit JVM. Since the majority of modern * systems are 64 bits, this method "assumes" 64 bits and only returns true * if sun.arch.data.model explicitly indicates a 32-bit JVM. * * @return true if we can determine definitively that this is a 32-bit JVM, * otherwise false */ private static boolean is32BitJvm() { Integer bits = Integer.getInteger("sun.arch.data.model"); return bits != null && bits == 32; } }