public abstract class SystemVersion extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DAEMON_USER |
static boolean |
DEFAULT_OVERRIDE_IS_SLOW |
static String |
GENTOO_USER |
static String |
PROP_OVERRIDE_IS_SLOW |
| Constructor and Description |
|---|
SystemVersion() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getActiveThreads()
Returns the current number of active (live) threads in the JVM.
|
static int |
getAndroidVersion()
Identical to android.os.Build.VERSION.SDK_INT.
|
static String |
getArch()
returns the architecture of the system running I2P as a string
for reference in clients.config and plugin.config files.
|
static int |
getCores()
Runtime.getRuntime().availableProcssors()
|
static int |
getCPULoad()
Retrieve CPU Load of the JVM.
|
static int |
getCPULoadAvg()
Retrieve CPU Load Average of the JVM.
|
static long |
getMaxMemory()
Runtime.getRuntime().maxMemory() but check for bogus values
|
static String |
getOS()
returns the OS of the system running I2P as a lower-case string
for reference in clients.config and plugin.config files.
|
static int |
getSystemLoad()
Retrieve System Load as percentage (100% equals full system load)
|
static TimeZone |
getSystemTimeZone()
The system's time zone, which is probably different from the
JVM time zone, because Router changes the JVM default to GMT.
|
static TimeZone |
getSystemTimeZone(I2PAppContext ctx)
The system's time zone, which is probably different from the
JVM time zone, because Router changes the JVM default to GMT.
|
static int |
getTunnelBuildSuccess()
Retrieve Tunnel build success as a percentage.
|
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 |
isARM() |
static boolean |
isGentoo() |
static boolean |
isGNU()
gij or JamVM with GNU Classpath
|
static boolean |
isJava(int minVersion)
Handles Android also
|
static boolean |
isJava(String minVersion)
Handles Android, and minVersions in both forms (e.g.
|
static boolean |
isJava10() |
static boolean |
isJava11() |
static boolean |
isJava12() |
static boolean |
isJava13() |
static boolean |
isJava14() |
static boolean |
isJava15() |
static boolean |
isJava16() |
static boolean |
isJava17() |
static boolean |
isJava18() |
static boolean |
isJava19() |
static boolean |
isJava20() |
static boolean |
isJava21() |
static boolean |
isJava22() |
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 |
isJava7()
Better than (new VersionComparator()).compare(System.getProperty("java.version"), "1.7") >= 0
as it handles Android also, where java.version = "0".
|
static boolean |
isJava8() |
static boolean |
isJava9() |
static boolean |
isLinuxService() |
static boolean |
isMac() |
static boolean |
isOpenJDK() |
static boolean |
isService() |
static boolean |
isSlow()
Our best guess on whether this is a slow architecture / OS / JVM,
using some simple heuristics.
|
static boolean |
isWindows() |
static boolean |
isWindowsService() |
static boolean |
isX86() |
static boolean |
isZeroVM()
Is this a very slow interpreted mode VM?
|
static void |
main(String[] args) |
static int |
usableCores()
calculate how many (virtual) cores should be actually used by a thread pool
|
public static final String DAEMON_USER
public static final boolean DEFAULT_OVERRIDE_IS_SLOW
public static final String GENTOO_USER
public static final String PROP_OVERRIDE_IS_SLOW
public static int getActiveThreads()
public static int getAndroidVersion()
public static String getArch()
public static int getCores()
public static int getCPULoad()
public static int getCPULoadAvg()
public static long getMaxMemory()
public static String getOS()
public static int getSystemLoad()
public static TimeZone getSystemTimeZone()
public static TimeZone getSystemTimeZone(I2PAppContext ctx)
public static int getTunnelBuildSuccess()
public static boolean hasWrapper()
public static boolean is64Bit()
public static boolean isAndroid()
public static boolean isApache()
public static boolean isARM()
public static boolean isGentoo()
public static boolean isGNU()
public static boolean isJava(int minVersion)
minVersion - e.g. 11public static boolean isJava(String minVersion)
minVersion - either 1.x or x form workspublic static boolean isJava10()
public static boolean isJava11()
public static boolean isJava12()
public static boolean isJava13()
public static boolean isJava14()
public static boolean isJava15()
public static boolean isJava16()
public static boolean isJava17()
public static boolean isJava18()
public static boolean isJava19()
public static boolean isJava20()
public static boolean isJava21()
public static boolean isJava22()
public static boolean isJava6()
public static boolean isJava7()
public static boolean isJava8()
public static boolean isJava9()
public static boolean isLinuxService()
public static boolean isMac()
public static boolean isOpenJDK()
public static boolean isService()
public static boolean isSlow()
public static boolean isWindows()
public static boolean isWindowsService()
public static boolean isX86()
public static boolean isZeroVM()
public static void main(String[] args)
public static int usableCores()