System.
If a system property cannot be read due to security restrictions, the corresponding field in this class will be set to null and a message will be
written to System.err.
#ThreadSafe#
SystemProperties
| Modifier and Type | Field and Description |
|---|---|
| public static final String | AWT_TOOLKIT
Deprecated
Deprecated without replacement.
A constant for the System Property awt.toolkit.
|
| public static final String | FILE_ENCODING
A constant for the System Property |
| public static final String | FILE_SEPARATOR
Deprecated
Use A constant for the System Property File#separator, since it is guaranteed to be a string containing a single character and it does not require a privilege check.
file.separator.
|
| public static final boolean | IS_JAVA_10
The constant |
| public static final boolean | IS_JAVA_11
The constant |
| public static final boolean | IS_JAVA_12
The constant |
| public static final boolean | IS_JAVA_13
The constant |
| public static final boolean | IS_JAVA_14
The constant |
| public static final boolean | IS_JAVA_15
The constant |
| public static final boolean | IS_JAVA_16
The constant |
| public static final boolean | IS_JAVA_17
The constant |
| public static final boolean | IS_JAVA_18
The constant |
| public static final boolean | IS_JAVA_19
The constant |
| public static final boolean | IS_JAVA_1_1
The constant |
| public static final boolean | IS_JAVA_1_2
The constant |
| public static final boolean | IS_JAVA_1_3
The constant |
| public static final boolean | IS_JAVA_1_4
The constant |
| public static final boolean | IS_JAVA_1_5
The constant |
| public static final boolean | IS_JAVA_1_6
The constant |
| public static final boolean | IS_JAVA_1_7
The constant |
| public static final boolean | IS_JAVA_1_8
The constant |
| public static final boolean | IS_JAVA_1_9
Deprecated
As of release 3.5, replaced by The constant IS_JAVA_9.
true if this is Java version 1.9 (also 1.9.x versions).
|
| public static final boolean | IS_JAVA_20
The constant |
| public static final boolean | IS_JAVA_21
The constant |
| public static final boolean | IS_JAVA_22
The constant |
| public static final boolean | IS_JAVA_23
The constant |
| public static final boolean | IS_JAVA_24
The constant |
| public static final boolean | IS_JAVA_25
The constant |
| public static final boolean | IS_JAVA_26
The constant |
| public static final boolean | IS_JAVA_9
The constant |
| public static final boolean | IS_OS_400
The constant |
| public static final boolean | IS_OS_AIX
The constant |
| public static final boolean | IS_OS_ANDROID
The constant |
| public static final boolean | IS_OS_FREE_BSD
The constant |
| public static final boolean | IS_OS_HP_UX
The constant |
| public static final boolean | IS_OS_IRIX
The constant |
| public static final boolean | IS_OS_LINUX
The constant |
| public static final boolean | IS_OS_MAC
The constant |
| public static final boolean | IS_OS_MAC_OSX
The constant |
| public static final boolean | IS_OS_MAC_OSX_BIG_SUR
The constant |
| public static final boolean | IS_OS_MAC_OSX_CATALINA
The constant |
| public static final boolean | IS_OS_MAC_OSX_CHEETAH
The constant |
| public static final boolean | IS_OS_MAC_OSX_EL_CAPITAN
The constant |
| public static final boolean | IS_OS_MAC_OSX_HIGH_SIERRA
The constant |
| public static final boolean | IS_OS_MAC_OSX_JAGUAR
The constant |
| public static final boolean | IS_OS_MAC_OSX_LEOPARD
The constant |
| public static final boolean | IS_OS_MAC_OSX_LION
The constant |
| public static final boolean | IS_OS_MAC_OSX_MAVERICKS
The constant |
| public static final boolean | IS_OS_MAC_OSX_MOJAVE
The constant |
| public static final boolean | IS_OS_MAC_OSX_MONTEREY
The constant |
| public static final boolean | IS_OS_MAC_OSX_MOUNTAIN_LION
The constant |
| public static final boolean | IS_OS_MAC_OSX_PANTHER
The constant |
| public static final boolean | IS_OS_MAC_OSX_PUMA
The constant |
| public static final boolean | IS_OS_MAC_OSX_SEQUOIA
The constant |
| public static final boolean | IS_OS_MAC_OSX_SIERRA
The constant |
| public static final boolean | IS_OS_MAC_OSX_SNOW_LEOPARD
The constant |
| public static final boolean | IS_OS_MAC_OSX_SONOMA
The constant |
| public static final boolean | IS_OS_MAC_OSX_TIGER
The constant |
| public static final boolean | IS_OS_MAC_OSX_VENTURA
The constant |
| public static final boolean | IS_OS_MAC_OSX_YOSEMITE
The constant |
| public static final boolean | IS_OS_NET_BSD
The constant |
| public static final boolean | IS_OS_NETWARE
The constant |
| public static final boolean | IS_OS_OPEN_BSD
The constant |
| public static final boolean | IS_OS_OS2
The constant |
| public static final boolean | IS_OS_SOLARIS
The constant |
| public static final boolean | IS_OS_SUN_OS
The constant |
| public static final boolean | IS_OS_UNIX
The constant |
| public static final boolean | IS_OS_WINDOWS
The constant |
| public static final boolean | IS_OS_WINDOWS_10
The constant |
| public static final boolean | IS_OS_WINDOWS_11
The constant |
| public static final boolean | IS_OS_WINDOWS_2000
The constant |
| public static final boolean | IS_OS_WINDOWS_2003
The constant |
| public static final boolean | IS_OS_WINDOWS_2008
The constant |
| public static final boolean | IS_OS_WINDOWS_2012
The constant |
| public static final boolean | IS_OS_WINDOWS_7
The constant |
| public static final boolean | IS_OS_WINDOWS_8
The constant |
| public static final boolean | IS_OS_WINDOWS_95
The constant |
| public static final boolean | IS_OS_WINDOWS_98
The constant |
| public static final boolean | IS_OS_WINDOWS_ME
The constant |
| public static final boolean | IS_OS_WINDOWS_NT
The constant |
| public static final boolean | IS_OS_WINDOWS_VISTA
The constant |
| public static final boolean | IS_OS_WINDOWS_XP
The constant |
| public static final boolean | IS_OS_ZOS
The constant |
| public static final String | JAVA_AWT_FONTS
Deprecated
Deprecated without replacement.
A constant for the System Property java.awt.fonts.
|
| public static final String | JAVA_AWT_GRAPHICSENV
Deprecated
Deprecated without replacement.
A constant for the System Property java.awt.graphicsenv.
|
| public static final String | JAVA_AWT_HEADLESS
Deprecated
Deprecated without replacement.
A constant for the System Property java.awt.headless.
|
| public static final String | JAVA_AWT_PRINTERJOB
Deprecated
Deprecated without replacement.
A constant for the System Property java.awt.printerjob.
|
| public static final String | JAVA_CLASS_PATH
A constant for the System Property |
| public static final String | JAVA_CLASS_VERSION
A constant for the System Property |
| public static final String | JAVA_COMPILER
Deprecated
Deprecated without replacement; see https://bugs.openjdk.org/browse/JDK-8305998
A constant for the System Property java.compiler.
|
| public static final String | JAVA_ENDORSED_DIRS
Deprecated
Deprecated without replacement.
A constant for the System Property java.endorsed.dirs.
|
| public static final String | JAVA_EXT_DIRS
Deprecated
Deprecated without replacement.
A constant for the System Property java.ext.dirs.
|
| public static final String | JAVA_HOME
A constant for the System Property |
| public static final String | JAVA_HOME_KEY
Deprecated
Use The System property key for the Java home directory.
SystemProperties#JAVA_HOME.
|
| public static final String | JAVA_IO_TMPDIR
A constant for the System Property |
| public static final String | JAVA_IO_TMPDIR_KEY
Deprecated
Use The System property key for the Java IO temporary directory.
SystemProperties#JAVA_IO_TMPDIR.
|
| public static final String | JAVA_LIBRARY_PATH
A constant for the System Property |
| public static final String | JAVA_RUNTIME_NAME
A constant for the System Property |
| public static final String | JAVA_RUNTIME_VERSION
A constant for the System Property |
| public static final String | JAVA_SPECIFICATION_NAME
A constant for the System Property |
| public static final String | JAVA_SPECIFICATION_VENDOR
A constant for the System Property |
| public static final String | JAVA_SPECIFICATION_VERSION
A constant for the System Property |
| private static final JavaVersion | |
| public static final String | JAVA_UTIL_PREFS_PREFERENCES_FACTORY
A constant for the System Property |
| public static final String | JAVA_VENDOR
A constant for the System Property |
| public static final String | JAVA_VENDOR_URL
A constant for the System Property |
| public static final String | JAVA_VERSION
A constant for the System Property |
| public static final String | JAVA_VM_INFO
A constant for the System Property |
| public static final String | JAVA_VM_NAME
A constant for the System Property |
| public static final String | JAVA_VM_SPECIFICATION_NAME
A constant for the System Property |
| public static final String | JAVA_VM_SPECIFICATION_VENDOR
A constant for the System Property |
| public static final String | JAVA_VM_SPECIFICATION_VERSION
A constant for the System Property |
| public static final String | JAVA_VM_VENDOR
A constant for the System Property |
| public static final String | JAVA_VM_VERSION
A constant for the System Property |
| public static final String | LINE_SEPARATOR
Deprecated
Use A constant for the System Property System#lineSeparator() instead, since it does not require a privilege check.
line.separator.
|
| public static final String | OS_ARCH
A constant for the System Property |
| public static final String | OS_NAME
A constant for the System Property |
| private static final String | OS_NAME_WINDOWS_PREFIX
The prefix String for all Windows OS. |
| public static final String | OS_VERSION
A constant for the System Property |
| public static final String | PATH_SEPARATOR
Deprecated
Use A constant for the System Property File#pathSeparator, since it is guaranteed to be a string containing a single character and it does not require a privilege
check.
path.separator.
|
| public static final String | USER_COUNTRY
A constant for the System Property |
| public static final String | USER_DIR
A constant for the System Property |
| public static final String | USER_DIR_KEY
Deprecated
Use The System property key for the user directory.
SystemProperties#USER_DIR.
|
| public static final String | USER_HOME
A constant for the System Property |
| public static final String | USER_HOME_KEY
The System property key for the user home directory. |
| public static final String | USER_LANGUAGE
A constant for the System Property |
| public static final String | USER_NAME
A constant for the System Property |
| public static final String | USER_NAME_KEY
Deprecated
Use The System property key for the user name.
SystemProperties#USER_NAME.
|
| public static final String | USER_TIMEZONE
A constant for the System Property |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static String | Returns: the environment variable value ordefaultValue if a security problem occurs.the environment variable name. name, final String the default value. defaultValue)Gets an environment variable, defaulting to |
| public static String | Returns: the host name. Will benull if the environment variable is not defined.Gets the host name from an environment variable ( |
| public static File | |
| public static Path | |
| public static File | |
| public static Path | |
| private static boolean | Returns: true if matches, or false if not or can't determine.the prefix for the Java version. versionPrefix)Tests if the Java version matches the version we are running. |
| private static boolean | Returns: true if matches, or false if not or can't determine.the prefix for the OS name. osNamePrefix, final String the prefix for the version. osVersionPrefix)Tests if the operating system matches the given name prefix and version prefix. |
| private static boolean | Returns: true if matches, or false if not or can't determine.the prefix for the OS name. osNamePrefix)Tests if the operating system matches the given string with a case-insensitive comparison. |
| public static File | |
| public static Path | |
| public static File | |
| public static Path | |
| public static String | Returns: a name.
Deprecated
Use
SystemProperties#getUserName().
Gets the current user name. |
| public static String | Returns: a name.A default value. defaultValue)
Deprecated
Use
SystemProperties#getUserName(String).
Gets the user name. |
| public static boolean | Returns: true if JAVA_AWT_HEADLESS is "true", false otherwise.
Deprecated
Deprecated without replacement.
Tests whether the |
| public static boolean | Returns: true if the actual version is equal or greater than the required version.the required version, for example 1.31f. requiredVersion)Tests whether the Java version is at least the requested version. |
| public static boolean | Returns: true if the actual version is equal or less than the required version.the required version, for example 1.31f. requiredVersion)Tests whether the Java version is at most the requested version. |
| pack-priv static boolean | Returns: true if matches, or false if not or can't determine.the actual Java version. version, final String the prefix for the expected Java version. versionPrefix)Tests whether the Java version matches. |
| pack-priv static boolean | Returns: true if matches, or false if not or can't determine.the actual OS name. osName, final String the actual OS version. osVersion, final String the prefix for the expected OS name. osNamePrefix, final String the prefix for the expected OS version. osVersionPrefix)Tests whether the operating system matches. |
| pack-priv static boolean | Returns: true for a case-insensitive match, or false if not.the actual OS name. osName, final String the prefix for the expected OS name. osNamePrefix)Tests whether the operating system matches with a case-insensitive comparison. |
| pack-priv static boolean | Returns: true if matches, or false if not or can't determine.the actual OS version. osVersion, final String the prefix for the expected OS version. osVersionPrefix)Tests whether the operating system version matches. |