net.i2p.util
Class SystemVersion

java.lang.Object
  extended by net.i2p.util.SystemVersion

public abstract class SystemVersion
extends Object

Methods to find out what system we are running on

Since:
0.9.3 consolidated from various places

Constructor Summary
SystemVersion()
           
 
Method Summary
static int getAndroidVersion()
          Identical to android.os.Build.VERSION.SDK_INT.
static boolean hasWrapper()
          Is the wrapper present? Same as I2PAppContext.hasWrapper()
static boolean is64Bit()
          This isn't always correct.
static boolean isAndroid()
           
static boolean isApache()
          Apache Harmony JVM, or Android
static boolean isGNU()
          gij or JamVM with GNU Classpath
static boolean isJava6()
          Better than (new VersionComparator()).compare(System.getProperty("java.version"), "1.6") >= 0 as it handles Android also, where java.version = "0".
static boolean isMac()
           
static boolean isWindows()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemVersion

public SystemVersion()
Method Detail

isWindows

public static boolean isWindows()

isMac

public static boolean isMac()

isAndroid

public static boolean isAndroid()

isApache

public static boolean isApache()
Apache Harmony JVM, or Android


isGNU

public static boolean isGNU()
gij or JamVM with GNU Classpath


isJava6

public static boolean isJava6()
Better than (new VersionComparator()).compare(System.getProperty("java.version"), "1.6") >= 0 as it handles Android also, where java.version = "0".

Returns:
true if Java 1.6 or higher, or Android API 9 or higher

is64Bit

public static boolean is64Bit()
This isn't always correct. http://stackoverflow.com/questions/807263/how-do-i-detect-which-kind-of-jre-is-installed-32bit-vs-64bit http://mark.koli.ch/2009/10/javas-osarch-system-property-is-the-bitness-of-the-jre-not-the-operating-system.html http://mark.koli.ch/2009/10/reliably-checking-os-bitness-32-or-64-bit-on-windows-with-a-tiny-c-app.html sun.arch.data.model not on all JVMs sun.arch.data.model == 64 => 64 bit processor sun.arch.data.model == 32 => A 32 bit JVM but could be either 32 or 64 bit processor or libs os.arch contains "64" could be 32 or 64 bit libs


getAndroidVersion

public static int getAndroidVersion()
Identical to android.os.Build.VERSION.SDK_INT. For use outside of Android code.

Returns:
The SDK (API) version, e.g. 8 for Froyo, 0 if unknown

hasWrapper

public static boolean hasWrapper()
Is the wrapper present? Same as I2PAppContext.hasWrapper()