public enum SystemProperty extends Enum<SystemProperty>
This enum is supposed to be a complete list of available system
properties on different JVM and Java versions. And with complete I don't mean
the list documented at System.getProperties(). I mean properties that
are specific to different verndors, versions and operating stystems.
Use get() or toString() to access the property values or
set(String) to update them - but only those that aren't read-only (
isReadOnly()).
If you discover some new properties in your
environment, please run the contained main(String[]) method and send
the output to me:
You may want to check for updates once in a while: SystemProperty.java and Molindo Techblog: The Final Take On Java System Properties
List of tested JVMs
If your JVM is missing,
please send
me your output of the included main(String[]) method
System.getProperties()| Enum Constant and Description |
|---|
AWT_NATIVE_DOUBLE_BUFFERING
Mac only: true or false
|
AWT_TOOLKIT
Mac only: known values: apple.awt.CToolkit
|
COM_IBM_CPU_ENDIAN
AIX only: known values: big
|
COM_IBM_OTI_CONFIGURATION
AIX only: known values: scar
|
COM_IBM_OTI_JCL_BUILD
AIX only: known values: 20081111_1646
|
COM_IBM_OTI_VM_BOOTSTRAP_LIBRARY_PATH
AIX only: known values: /prj/was/java/jre/bin
|
COM_IBM_OTI_VM_LIBRARY_VERSION
AIX only: known values: 23
|
COM_IBM_UTIL_EXTRALIBS_PROPERTIES
AIX only: known values:
|
COM_IBM_VM_BITMODE
AIX only: known values: 32
|
FILE_ENCODING
Known values: "MacRoman": Mac OS X
"Cp1252": Windows XP "UTF-8": CentOS, Ubuntu Hardy/JVM 1.5,
Ubuntu Hardy/Open JDK 6 "ISO-8859-1": Ubuntu Hardy/JVM 1.6
|
FILE_ENCODING_PKG
This property is available on all
|
FILE_SEPARATOR
System.getProperties() doc: File separator ("/" on UNIX) |
FTP_NON_PROXY_HOSTS
Mac only: known values: local|*.local|169.254/16|*.169.254/16
|
GNU_CLASSPATH_HOME
GCJ only: known values: /usr
|
GNU_CLASSPATH_HOME_URL
GCJ only: known values: file:///usr/lib64
|
GNU_CLASSPATH_VERSION
GCJ only: known values: 0.98
|
GNU_CLASSPATH_VM_SHORTNAME
GCJ only: known values: libgcj
|
GNU_CPU_ENDIAN
GCJ only: known values: little
|
GNU_GCJ_PRECOMPILED_DB_PATH
GCJ only: known values: /usr/lib64/gcj-4.4.1/classmap.db
|
GNU_GCJ_PROGNAME
GCJ only: known values: SystemProperty
|
GNU_GCJ_RUNTIME_ENDORSED_DIRS
GCJ only: known values: /usr/share/java/gcj-endorsed
|
GNU_GCJ_USER_REALNAME
GCJ only: known values:
|
GNU_JAVA_UTIL_ZONEINFO_DIR
GCJ only: known values: /usr/share/zoneinfo
|
GOPHER_PROXY_SET
Mac only: true or false
|
GROOVY_HOME
Groovy only: known values: /opt/groovy-1.6.4
|
GROOVY_STARTER_CONF
Groovy only: known values: /opt/groovy-1.6.4/conf/groovy-starter.conf
|
HTTP_AGENT
GCJ only: known values: gnu-classpath/0.98 (libgcj/4.4.1 20090725 (Red
Hat 4.4.1-2))
|
HTTP_NON_PROXY_HOSTS
Mac only: known values: local|*.local|169.254/16|*.169.254/16
|
IBM_SIGNALHANDLING_RS
AIX only: known values: false
|
IBM_SIGNALHANDLING_SIGCHAIN
AIX only: known values: true
|
IBM_SIGNALHANDLING_SIGINT
AIX only: known values: true
|
IBM_SYSTEM_ENCODING
AIX only: known values: ISO8859-1
|
INVOKEDVIAJAVA
AIX only: known values:
|
JAVA_ASSISTIVE
AIX only: known values: ON
|
JAVA_AWT_FONTS
AIX only: known values:
|
JAVA_AWT_GRAPHICSENV
Known values:
"sun.awt.X11GraphicsEnvironment": Ubuntu Hardy
"apple.awt.CGraphicsEnvironment": Mac OS X
"sun.awt.Win32GraphicsEnvironment": Windows XP
|
JAVA_AWT_HEADLESS
turns on headless mode
|
JAVA_AWT_PRINTERJOB |
JAVA_CLASS_PATH |
JAVA_CLASS_VERSION |
JAVA_COMPILER |
JAVA_ENDORSED_DIRS |
JAVA_EXT_DIRS |
JAVA_FULLVERSION
GCJ only: known values: GNU libgcj 4.4.1 20090725 (Red Hat 4.4.1-2)
|
JAVA_HOME |
JAVA_IO_TMPDIR
path to temporary directory including trailing file separator
|
JAVA_JCL_VERSION
AIX only: known values: 20090506
|
JAVA_LIBRARY_PATH |
JAVA_RUNTIME_NAME |
JAVA_RUNTIME_VERSION |
JAVA_SPECIFICATION_NAME |
JAVA_SPECIFICATION_VENDOR |
JAVA_SPECIFICATION_VERSION |
JAVA_UTIL_PREFS__PREFERENCES_FACTORY
AIX only: known values: java.util.prefs.FileSystemPreferencesFactory
|
JAVA_VENDOR |
JAVA_VENDOR_URL |
JAVA_VENDOR_URL_BUG |
JAVA_VERSION |
JAVA_VM_INFO |
JAVA_VM_NAME
This property may be used to distinguis between a JVM running in defaul
(client) and server mode
known values: "Java HotSpot(TM) 64-Bit Server VM",
"Java HotSpot(TM) Client VM"
|
JAVA_VM_SERVER
returns true if VM is running in "Server Mode" (java -server).
|
JAVA_VM_SPECIFICATION_NAME |
JAVA_VM_SPECIFICATION_VENDOR |
JAVA_VM_SPECIFICATION_VERSION |
JAVA_VM_VENDOR |
JAVA_VM_VERSION |
JXE_CURRENT_ROMIMAGE_VERSION
AIX only: known values: 9
|
JXE_LOWEST_ROMIMAGE_VERSION
AIX only: known values: 9
|
LINE_SEPARATOR |
MRJ_VERSION
Mac only: known values: 1060.1.6.0_15-219
|
OS_ARCH |
OS_FAMILY
windows if OS name contains the word
"windows" os/2 if OS name contains the word
"os/2" netware if OS name contains the word
"netware" dos if OS family is not "netware",
and its path separator is ";" mac if OS name
contains the word "mac" tandem if OS name
contains the word "nonstop_kernel" unix if OS
family is not "openvms" and not "mac" which names does not end with "X",
and its path separator is ":" win9x is OS
family is "windows" and OS name contains "95", "98", "me", or "ce"
z/os if OS name contains the word "z/os" or "os/390"
os/400 if OS name contains the word
"os/400" openvms if OS name contains the word
"openvms" unknown if none of the above matches
|
OS_NAME
see http://lopica.sourceforge.net/os.html for possible values
|
OS_VERSION |
PATH_SEPARATOR |
PROGRAM_NAME
Groovy only: known values: groovy
|
SOCKS_NON_PROXY_HOSTS
Mac only: known values: local|*.local|169.254/16|*.169.254/16
|
SUN_ARCH_DATA_MODEL |
SUN_AWT_DISABLE_MIXING
TODO doc (hint: for Sun VM on Java 6u14+)
|
SUN_AWT_NOERASEBACKGROUND
TODO doc
|
SUN_AWT_XEMBEDSERVER
TODO doc
|
SUN_BOOT_CLASS_PATH |
SUN_BOOT_LIBRARY_PATH |
SUN_CPU_ENDIAN |
SUN_CPU_ISALIST |
SUN_DESKTOP
Linux only: known values: gnome
|
SUN_IO_UNICODE_ENCODING |
SUN_JAVA_LAUNCHER |
SUN_JAVA2D_FONTPATH
AIX only: known values:
|
SUN_JNU_ENCODING |
SUN_MANAGEMENT_COMPILER |
SUN_OS_PATCH_LEVEL |
USER_COUNTRY |
USER_DIR |
USER_HOME |
USER_LANGUAGE |
USER_NAME |
USER_REGION
GCJ only: known values: US
|
USER_TIMEZONE |
USER_VARIANT
Windows only: known values: "" (empty string)
|
USER_ZONEINFO_DIR
Linux only (seen on Sun an OpenJDK JVMs): known values: /usr/share/javazi
|
| Modifier and Type | Method and Description |
|---|---|
String |
get() |
String |
get(String def) |
Boolean |
getBoolean() |
Boolean |
getBoolean(Boolean def) |
String |
getDefault()
the default return value if property is not set.
|
Double |
getDouble() |
Double |
getDouble(Double def) |
File |
getFile() |
File |
getFile(String def) |
Float |
getFloat() |
Float |
getFloat(Float def) |
Integer |
getInteger() |
Integer |
getInteger(Integer def) |
Long |
getLong() |
Long |
getLong(Long def) |
String |
getName() |
boolean |
isDerived() |
boolean |
isReadOnly()
whether this property should not be modified (i.e.
|
static void |
main(String[] args)
a simple main method to list available system properties.
|
String |
set(String value) |
String |
setBoolean(Boolean value) |
String |
setDouble(Double value) |
String |
setFile(File value) |
String |
setFloat(Float value) |
String |
setInteger(Integer value) |
String |
setLong(Long value) |
String |
toDebugString() |
static String |
toEnumName(String property)
generate a new enum name from a system property
|
String |
toString() |
String |
unset() |
static SystemProperty |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SystemProperty[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SystemProperty FILE_ENCODING
Known values:
System.getProperties() doc.public static final SystemProperty FILE_ENCODING_PKG
Known values:
System.getProperties() doc.public static final SystemProperty FILE_SEPARATOR
System.getProperties() doc: File separator ("/" on UNIX)
Known values:
public static final SystemProperty JAVA_AWT_GRAPHICSENV
Known values:
System.getProperties() doc.public static final SystemProperty JAVA_AWT_PRINTERJOB
public static final SystemProperty JAVA_CLASS_PATH
public static final SystemProperty JAVA_CLASS_VERSION
public static final SystemProperty JAVA_COMPILER
public static final SystemProperty JAVA_ENDORSED_DIRS
public static final SystemProperty JAVA_EXT_DIRS
public static final SystemProperty JAVA_HOME
public static final SystemProperty JAVA_IO_TMPDIR
public static final SystemProperty JAVA_LIBRARY_PATH
public static final SystemProperty JAVA_RUNTIME_NAME
public static final SystemProperty JAVA_RUNTIME_VERSION
public static final SystemProperty JAVA_SPECIFICATION_NAME
public static final SystemProperty JAVA_SPECIFICATION_VENDOR
public static final SystemProperty JAVA_SPECIFICATION_VERSION
public static final SystemProperty JAVA_VERSION
public static final SystemProperty JAVA_VENDOR
public static final SystemProperty JAVA_VENDOR_URL
public static final SystemProperty JAVA_VENDOR_URL_BUG
public static final SystemProperty JAVA_VM_INFO
public static final SystemProperty JAVA_VM_NAME
public static final SystemProperty JAVA_VM_SPECIFICATION_NAME
public static final SystemProperty JAVA_VM_SPECIFICATION_VENDOR
public static final SystemProperty JAVA_VM_SPECIFICATION_VERSION
public static final SystemProperty JAVA_VM_VERSION
public static final SystemProperty JAVA_VM_VENDOR
public static final SystemProperty LINE_SEPARATOR
public static final SystemProperty OS_NAME
public static final SystemProperty OS_ARCH
public static final SystemProperty OS_VERSION
public static final SystemProperty PATH_SEPARATOR
public static final SystemProperty SUN_ARCH_DATA_MODEL
public static final SystemProperty SUN_BOOT_CLASS_PATH
public static final SystemProperty SUN_BOOT_LIBRARY_PATH
public static final SystemProperty SUN_CPU_ENDIAN
public static final SystemProperty SUN_CPU_ISALIST
public static final SystemProperty SUN_IO_UNICODE_ENCODING
public static final SystemProperty SUN_JAVA_LAUNCHER
public static final SystemProperty SUN_JNU_ENCODING
public static final SystemProperty SUN_MANAGEMENT_COMPILER
public static final SystemProperty SUN_OS_PATCH_LEVEL
public static final SystemProperty USER_COUNTRY
public static final SystemProperty USER_DIR
public static final SystemProperty USER_HOME
public static final SystemProperty USER_LANGUAGE
public static final SystemProperty USER_NAME
public static final SystemProperty USER_TIMEZONE
public static final SystemProperty USER_VARIANT
public static final SystemProperty SUN_DESKTOP
public static final SystemProperty USER_ZONEINFO_DIR
public static final SystemProperty AWT_NATIVE_DOUBLE_BUFFERING
public static final SystemProperty AWT_TOOLKIT
public static final SystemProperty FTP_NON_PROXY_HOSTS
public static final SystemProperty GOPHER_PROXY_SET
public static final SystemProperty HTTP_NON_PROXY_HOSTS
public static final SystemProperty MRJ_VERSION
public static final SystemProperty SOCKS_NON_PROXY_HOSTS
public static final SystemProperty GNU_CLASSPATH_HOME
public static final SystemProperty GNU_CLASSPATH_HOME_URL
public static final SystemProperty GNU_CLASSPATH_VERSION
public static final SystemProperty GNU_CLASSPATH_VM_SHORTNAME
public static final SystemProperty GNU_CPU_ENDIAN
public static final SystemProperty GNU_GCJ_PRECOMPILED_DB_PATH
public static final SystemProperty GNU_GCJ_PROGNAME
public static final SystemProperty GNU_GCJ_RUNTIME_ENDORSED_DIRS
public static final SystemProperty GNU_GCJ_USER_REALNAME
public static final SystemProperty GNU_JAVA_UTIL_ZONEINFO_DIR
public static final SystemProperty HTTP_AGENT
public static final SystemProperty JAVA_FULLVERSION
public static final SystemProperty USER_REGION
public static final SystemProperty COM_IBM_CPU_ENDIAN
public static final SystemProperty COM_IBM_OTI_CONFIGURATION
public static final SystemProperty COM_IBM_OTI_JCL_BUILD
public static final SystemProperty COM_IBM_OTI_VM_BOOTSTRAP_LIBRARY_PATH
public static final SystemProperty COM_IBM_OTI_VM_LIBRARY_VERSION
public static final SystemProperty COM_IBM_UTIL_EXTRALIBS_PROPERTIES
public static final SystemProperty COM_IBM_VM_BITMODE
public static final SystemProperty IBM_SIGNALHANDLING_RS
public static final SystemProperty IBM_SIGNALHANDLING_SIGCHAIN
public static final SystemProperty IBM_SIGNALHANDLING_SIGINT
public static final SystemProperty IBM_SYSTEM_ENCODING
public static final SystemProperty INVOKEDVIAJAVA
public static final SystemProperty JAVA_ASSISTIVE
public static final SystemProperty JAVA_AWT_FONTS
public static final SystemProperty JAVA_JCL_VERSION
public static final SystemProperty JAVA_UTIL_PREFS__PREFERENCES_FACTORY
public static final SystemProperty JXE_CURRENT_ROMIMAGE_VERSION
public static final SystemProperty JXE_LOWEST_ROMIMAGE_VERSION
public static final SystemProperty SUN_JAVA2D_FONTPATH
public static final SystemProperty PROGRAM_NAME
public static final SystemProperty GROOVY_HOME
public static final SystemProperty GROOVY_STARTER_CONF
public static final SystemProperty JAVA_AWT_HEADLESS
public static final SystemProperty SUN_AWT_DISABLE_MIXING
public static final SystemProperty SUN_AWT_NOERASEBACKGROUND
public static final SystemProperty SUN_AWT_XEMBEDSERVER
public static final SystemProperty OS_FAMILY
public static final SystemProperty JAVA_VM_SERVER
returns true if VM is running in "Server Mode" (java -server). This
is only true if java.vm.name starts with "Java HotSpot(TM)" and contains
"Server". null is returned if java.vm.name is null (which
should never be the case).
public static SystemProperty[] values()
for (SystemProperty c : SystemProperty.values()) System.out.println(c);
public static SystemProperty valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant
with the specified nameNullPointerException - if the argument is nullpublic String get()
null if
there is no property with that key and getDefault() is
null tooSystem.getProperty(String),
AccessController.doPrivileged(PrivilegedAction)public String get(String def)
def if
there is no property with that key. (getDefault() is
ignored)System.getProperty(String),
AccessController.doPrivileged(PrivilegedAction)public Boolean getBoolean()
null if get()
returned nullget(),
Boolean.parseBoolean(String)public Boolean getBoolean(Boolean def)
null if
get(String) returned nullget(),
Integer.parseInt(String)public Integer getInteger() throws NumberFormatException
null if get()
returned nullNumberFormatExceptionget(),
Integer.parseInt(String)public Integer getInteger(Integer def) throws NumberFormatException
null if
get(String) returned nullNumberFormatExceptionget(),
Integer.parseInt(String)public Long getLong() throws NumberFormatException
null if get()
returned nullNumberFormatExceptionget(),
Long.parseLong(String)public Long getLong(Long def) throws NumberFormatException
null if get(String)
returned nullNumberFormatExceptionget(),
Long.parseLong(String)public Float getFloat() throws NumberFormatException
null if get()
returned nullNumberFormatExceptionget(),
Float.parseFloat(String)public Float getFloat(Float def) throws NumberFormatException
null if get(String)
returned nullNumberFormatExceptionget(),
Float.parseFloat(String)public Double getDouble() throws NumberFormatException
null if get()
returned nullNumberFormatExceptionget(),
Double.parseDouble(String)public Double getDouble(Double def) throws NumberFormatException
null if
get(String) returned nullNumberFormatExceptionget(),
Double.parseDouble(String)public File getFile()
public File getFile(String def)
def - default valueget(String) or nullget()public String set(String value)
value - the new valueUnsupportedOperationException - if this property is read-onlySystem.setProperty(String, String),
AccessController.doPrivileged(PrivilegedAction),
isReadOnly()public String setBoolean(Boolean value) throws NumberFormatException
NumberFormatExceptionpublic String setInteger(Integer value) throws NumberFormatException
NumberFormatExceptionpublic String setLong(Long value) throws NumberFormatException
NumberFormatExceptionpublic String setDouble(Double value) throws NumberFormatException
NumberFormatExceptionpublic String setFloat(Float value) throws NumberFormatException
NumberFormatExceptionpublic String setFile(File value) throws IOException
IOExceptionpublic String unset()
public String getName()
public boolean isReadOnly()
System.setProperty(String, String)
directly. It's use is discouraged though (as it might not have the
desired effect)true if this property should not be modifiedpublic boolean isDerived()
true if this is property doesn't exist but is
derived from another property (e.g. OS_FAMILY which is derived by
other properties, mainly OS_NAME)public String getDefault()
null. For example, the default for java.awt.headless is
"false"null if not
applicablepublic String toString()
toString in class Enum<SystemProperty>get()get()public String toDebugString()
public static void main(String[] args)
args - arguments are ignoredCopyright © 2014 Molindo GmbH. All Rights Reserved.