I've been inspired by another question: Best Practice for Using Java System Properties
I'm currently looking for a complete list of Java system properties and possible values. I'm working on a simple class to simplify use of them (If you're interested, get the source and background info (my blog)). With this class, I try to provide the following:
To get full documentation and a complete list of available properties (even those where availability is heavily JVM-dependent), I'd like you to download the source, run it and post your results. I'll update the class accordingly and keep it available at the given location. Hopefully, it will ease live of some of you out there :)
Edit:
I'm not looking for standard properties as described by System.getProperties() or all properties that are available on my system. I'm trying to create a comprehensive list of system properties - even those that are vendor, jvm or version related - those that aren't guaranteed to exist and whose documentation is sparse or hard to find. Properties like
I'd love to get others to run my code and post their results in order to compile a comprehensive list (with extensive documentation of properties and their possible values) in the form of a Java enum that's easy to use e.g.:
String file = SystemProperty.JAVA_IO_TMPDIR + "file.txt";
instead of
String tmp = System.getProperty("java.io.tmpdir");
if (!tmp.endsWith(File.separator)
tmp += File.separator;
new File(tmp).mkdirs(); // make sure tmp exists
String file = tmp + "file.txt";
So please run that code and post your findings. Here is a simple script to get you started:
#!/bin/bash
# download and run
# you should really look at the code first, as you can't be sure
# that I'm a trustworthy guy ;)
wget -N http://techblog.molindo.at/files/SystemProperty.java
javac SystemProperty.java
java SystemProperty
(I know this isn't a real question but rather a crowd sourcing thing. I hope nobody minds)
Bounty:
As there is no correct answer to this question, the bounty will be awarded to the person who discovers most new system properties. As a hint: testing non-standard JVMs (J2ME, Android, GCJ, OpenJDK, Apache Harmony, ...) and common languages on top of the JVM (Groovy, Scala, JRuby, ..) should be especially yielding.
Current leaders:
Btw, I'm planning to release the final result as a Maven artifact and upload it to the central repository as soon as I have enough input.
UPDATE: Public Repository, finally
SystemProperty.java is now available on GitHub, as part of the molindo-utils project. molindo-utils is currently available as 1.0-SNAPSHOT through Sonatype's OSS repository. As soon as it's ready for release, it will be synchronized to Maven central as well.
<repositories>
<repository>
<id>oss.sonatype.org</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>at.molindo</groupId>
<artifactId>molindo-utils</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
OS AIX 5.3, Java version:
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pap32devifx-20090506 (SR9-SSU +PK76176+IZ44410+IZ44495))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223ifx-20090225 (JIT enabled)
J9VM - 20090224_30451_bHdSMr
JIT - 20081112_1511ifx1_r8
GC - 200811_07)
SystemProperty output:
FILE_ENCODING: file.encoding=ISO8859-1 (read-only)
FILE_ENCODING_PKG: file.encoding.pkg=null (read-only)
FILE_SEPARATOR: file.separator=/ (read-only)
JAVA_AWT_GRAPHICSENV: java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment (read-only)
JAVA_AWT_PRINTERJOB: java.awt.printerjob=sun.print.PSPrinterJob (read-only)
JAVA_CLASS_PATH: java.class.path=. (read-only)
JAVA_CLASS_VERSION: java.class.version=49.0 (read-only)
JAVA_COMPILER: java.compiler=j9jit23 (read-only)
JAVA_ENDORSED_DIRS: java.endorsed.dirs=null (read-only)
JAVA_EXT_DIRS: java.ext.dirs=/prj/was/java/jre/lib/ext (read-only)
JAVA_HOME: java.home=/prj/was/java/jre (read-only)
JAVA_IO_TMPDIR: java.io.tmpdir=/tmp/
JAVA_LIBRARY_PATH: java.library.path=/prj/was/java/jre/bin:/prj/was/java/jre/bin:/prj/was/java/jre/bin/classic:/prj/was/java/jre/bin:/prj/was/java/jre/bin/j9vm:/usr/lib (read-only)
JAVA_RUNTIME_NAME: java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition (read-only)
JAVA_RUNTIME_VERSION: java.runtime.version=pap32devifx-20090506 (SR9-SSU +PK76176+IZ44410+IZ44495) (read-only)
JAVA_SPECIFICATION_NAME: java.specification.name=Java Platform API Specification (read-only)
JAVA_SPECIFICATION_VENDOR: java.specification.vendor=Sun Microsystems Inc. (read-only)
JAVA_SPECIFICATION_VERSION: java.specification.version=1.5 (read-only)
JAVA_VERSION: java.version=1.5.0 (read-only)
JAVA_VENDOR: java.vendor=IBM Corporation (read-only)
JAVA_VENDOR_URL: java.vendor.url=http://www.ibm.com/ (read-only)
JAVA_VENDOR_URL_BUG: java.vendor.url.bug=null (read-only)
JAVA_VM_INFO: java.vm.info=J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223ifx-20090225 (JIT enabled)
J9VM - 20090224_30451_bHdSMr
JIT - 20081112_1511ifx1_r8
GC - 200811_07 (read-only)
JAVA_VM_NAME: java.vm.name=IBM J9 VM (read-only)
JAVA_VM_SPECIFICATION_NAME: java.vm.specification.name=Java Virtual Machine Specification (read-only)
JAVA_VM_SPECIFICATION_VENDOR: java.vm.specification.vendor=Sun Microsystems Inc. (read-only)
JAVA_VM_SPECIFICATION_VERSION: java.vm.specification.version=1.0 (read-only)
JAVA_VM_VERSION: java.vm.version=2.3 (read-only)
JAVA_VM_VENDOR: java.vm.vendor=IBM Corporation (read-only)
LINE_SEPARATOR: line.separator=
(read-only)
OS_NAME: os.name=AIX (read-only)
OS_ARCH: os.arch=ppc (read-only)
OS_VERSION: os.version=5.3 (read-only)
PATH_SEPARATOR: path.separator=: (read-only)
SUN_ARCH_DATA_MODEL: sun.arch.data.model=32 (read-only)
SUN_BOOT_CLASS_PATH: sun.boot.class.path=/prj/was/java/jre/lib/vm.jar:/prj/was/java/jre/lib/core.jar:/prj/was/java/jre/lib/charsets.jar:/prj/was/java/jre/lib/graphics.jar:/prj/was/java/jre/lib/security.jar:/prj/was/java/jre/lib/ibmpkcs.jar:/prj/was/java/jre/lib/ibmorb.jar:/prj/was/java/jre/lib/ibmcfw.jar:/prj/was/java/jre/lib/ibmorbapi.jar:/prj/was/java/jre/lib/ibmjcefw.jar:/prj/was/java/jre/lib/ibmjgssprovider.jar:/prj/was/java/jre/lib/ibmjsseprovider2.jar:/prj/was/java/jre/lib/ibmjaaslm.jar:/prj/was/java/jre/lib/ibmcertpathprovider.jar:/prj/was/java/jre/lib/server.jar:/prj/was/java/jre/lib/xml.jar (read-only)
SUN_BOOT_LIBRARY_PATH: sun.boot.library.path=/prj/was/java/jre/bin (read-only)
SUN_CPU_ENDIAN: sun.cpu.endian=null (read-only)
SUN_CPU_ISALIST: sun.cpu.isalist=null (read-only)
SUN_IO_UNICODE_ENCODING: sun.io.unicode.encoding=UnicodeBig (read-only)
SUN_JAVA_LAUNCHER: sun.java.launcher=null (read-only)
SUN_JNU_ENCODING: sun.jnu.encoding=ISO8859-1 (read-only)
SUN_MANAGEMENT_COMPILER: sun.management.compiler=null (read-only)
SUN_OS_PATCH_LEVEL: sun.os.patch.level=null (read-only)
USER_COUNTRY: user.country=US (read-only)
USER_DIR: user.dir=/tmp/avd (read-only)
USER_HOME: user.home=/root (read-only)
USER_LANGUAGE: user.language=en (read-only)
USER_NAME: user.name=root (read-only)
USER_TIMEZONE: user.timezone= (read-only)
USER_VARIANT: user.variant= (read-only)
SUN_DESKTOP: sun.desktop=null (read-only)
USER_ZONEINFO_DIR: user.zoneinfo.dir=null (read-only)
AWT_NATIVE_DOUBLE_BUFFERING: awt.nativeDoubleBuffering=null (read-only)
AWT_TOOLKIT: awt.toolkit=null (read-only)
FTP_NON_PROXY_HOSTS: ftp.nonProxyHosts=null (read-only)
GOPHER_PROXY_SET: gopherProxySet=null (read-only)
HTTP_NON_PROXY_HOSTS: http.nonProxyHosts=null (read-only)
MRJ_VERSION: mrj.version=null (read-only)
SOCKS_NON_PROXY_HOSTS: socksNonProxyHosts=null (read-only)
GNU_CLASSPATH_HOME: gnu.classpath.home=null (read-only)
GNU_CLASSPATH_HOME_URL: gnu.classpath.home.url=null (read-only)
GNU_CLASSPATH_VERSION: gnu.classpath.version=null (read-only)
GNU_CLASSPATH_VM_SHORTNAME: gnu.classpath.vm.shortname=null (read-only)
GNU_CPU_ENDIAN: gnu.cpu.endian=null (read-only)
GNU_GCJ_PRECOMPILED_DB_PATH: gnu.gcj.precompiled.db.path=null (read-only)
GNU_GCJ_PROGNAME: gnu.gcj.progname=null (read-only)
GNU_GCJ_RUNTIME_ENDORSED_DIRS: gnu.gcj.runtime.endorsed.dirs=null (read-only)
GNU_GCJ_USER_REALNAME: gnu.gcj.user.realname=null (read-only)
GNU_JAVA_UTIL_ZONEINFO_DIR: gnu.java.util.zoneinfo.dir=null (read-only)
HTTP_AGENT: http.agent=null (read-only)
JAVA_FULLVERSION: java.fullversion=J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223ifx-20090225 (JIT enabled)
J9VM - 20090224_30451_bHdSMr
JIT - 20081112_1511ifx1_r8
GC - 200811_07 (read-only)
USER_REGION: user.region=null (read-only)
PROGRAM_NAME: program.name=null (read-only)
GROOVY_HOME: groovy.home=null (read-only)
GROOVY_STARTER_CONF: groovy.starter.conf=null (read-only)
JAVA_AWT_HEADLESS: java.awt.headless=false
SUN_AWT_DISABLE_MIXING: sun.awt.disableMixing=null
SUN_AWT_NOERASEBACKGROUND: sun.awt.noerasebackground=null
SUN_AWT_XEMBEDSERVER: sun.awt.xembedserver=null
OS_FAMILY: os.family=unknown (derived)
JAVA_VM_SERVER: java.vm.server=false (derived)
### UNKNOWN
FILE_ENCODING_PKG: file.encoding.pkg=null (read-only)
JAVA_ENDORSED_DIRS: java.endorsed.dirs=null (read-only)
JAVA_VENDOR_URL_BUG: java.vendor.url.bug=null (read-only)
SUN_CPU_ENDIAN: sun.cpu.endian=null (read-only)
SUN_CPU_ISALIST: sun.cpu.isalist=null (read-only)
SUN_JAVA_LAUNCHER: sun.java.launcher=null (read-only)
SUN_MANAGEMENT_COMPILER: sun.management.compiler=null (read-only)
SUN_OS_PATCH_LEVEL: sun.os.patch.level=null (read-only)
SUN_DESKTOP: sun.desktop=null (read-only)
USER_ZONEINFO_DIR: user.zoneinfo.dir=null (read-only)
AWT_NATIVE_DOUBLE_BUFFERING: awt.nativeDoubleBuffering=null (read-only)
AWT_TOOLKIT: awt.toolkit=null (read-only)
FTP_NON_PROXY_HOSTS: ftp.nonProxyHosts=null (read-only)
GOPHER_PROXY_SET: gopherProxySet=null (read-only)
HTTP_NON_PROXY_HOSTS: http.nonProxyHosts=null (read-only)
MRJ_VERSION: mrj.version=null (read-only)
SOCKS_NON_PROXY_HOSTS: socksNonProxyHosts=null (read-only)
GNU_CLASSPATH_HOME: gnu.classpath.home=null (read-only)
GNU_CLASSPATH_HOME_URL: gnu.classpath.home.url=null (read-only)
GNU_CLASSPATH_VERSION: gnu.classpath.version=null (read-only)
GNU_CLASSPATH_VM_SHORTNAME: gnu.classpath.vm.shortname=null (read-only)
GNU_CPU_ENDIAN: gnu.cpu.endian=null (read-only)
GNU_GCJ_PRECOMPILED_DB_PATH: gnu.gcj.precompiled.db.path=null (read-only)
GNU_GCJ_PROGNAME: gnu.gcj.progname=null (read-only)
GNU_GCJ_RUNTIME_ENDORSED_DIRS: gnu.gcj.runtime.endorsed.dirs=null (read-only)
GNU_GCJ_USER_REALNAME: gnu.gcj.user.realname=null (read-only)
GNU_JAVA_UTIL_ZONEINFO_DIR: gnu.java.util.zoneinfo.dir=null (read-only)
HTTP_AGENT: http.agent=null (read-only)
USER_REGION: user.region=null (read-only)
PROGRAM_NAME: program.name=null (read-only)
GROOVY_HOME: groovy.home=null (read-only)
GROOVY_STARTER_CONF: groovy.starter.conf=null (read-only)
JAVA_AWT_HEADLESS: java.awt.headless=false
SUN_AWT_DISABLE_MIXING: sun.awt.disableMixing=null
SUN_AWT_NOERASEBACKGROUND: sun.awt.noerasebackground=null
SUN_AWT_XEMBEDSERVER: sun.awt.xembedserver=null
OS_FAMILY: os.family=unknown (derived)
JAVA_VM_SERVER: java.vm.server=false (derived)
### MISSING
com.ibm.cpu.endian=big
com.ibm.oti.configuration=scar
com.ibm.oti.jcl.build=20081111_1646
com.ibm.oti.vm.bootstrap.library.path=/prj/was/java/jre/bin
com.ibm.oti.vm.library.version=23
com.ibm.util.extralibs.properties=
com.ibm.vm.bitmode=32
ibm.signalhandling.rs=false
ibm.signalhandling.sigchain=true
ibm.signalhandling.sigint=true
ibm.system.encoding=ISO8859-1
invokedviajava=
java.assistive=ON
java.awt.fonts=
java.jcl.version=20090506
java.util.prefs.PreferencesFactory=java.util.prefs.FileSystemPreferencesFactory
jxe.current.romimage.version=9
jxe.lowest.romimage.version=9
sun.java2d.fontpath=
### PLEASE POST FULL OUTPUT AT http://j.mp/props0 or http://j.mp/props1
/**
* AIX only: known values: big
*/
COM_IBM_CPU_ENDIAN("com.ibm.cpu.endian"),
/**
* AIX only: known values: scar
*/
COM_IBM_OTI_CONFIGURATION("com.ibm.oti.configuration"),
/**
* AIX only: known values: 20081111_1646
*/
COM_IBM_OTI_JCL_BUILD("com.ibm.oti.jcl.build"),
/**
* AIX only: known values: /prj/was/java/jre/bin
*/
COM_IBM_OTI_VM_BOOTSTRAP_LIBRARY_PATH("com.ibm.oti.vm.bootstrap.library.path"),
/**
* AIX only: known values: 23
*/
COM_IBM_OTI_VM_LIBRARY_VERSION("com.ibm.oti.vm.library.version"),
/**
* AIX only: known values:
*/
COM_IBM_UTIL_EXTRALIBS_PROPERTIES("com.ibm.util.extralibs.properties"),
/**
* AIX only: known values: 32
*/
COM_IBM_VM_BITMODE("com.ibm.vm.bitmode"),
/**
* AIX only: known values: false
*/
IBM_SIGNALHANDLING_RS("ibm.signalhandling.rs"),
/**
* AIX only: known values: true
*/
IBM_SIGNALHANDLING_SIGCHAIN("ibm.signalhandling.sigchain"),
/**
* AIX only: known values: true
*/
IBM_SIGNALHANDLING_SIGINT("ibm.signalhandling.sigint"),
/**
* AIX only: known values: ISO8859-1
*/
IBM_SYSTEM_ENCODING("ibm.system.encoding"),
/**
* AIX only: known values:
*/
INVOKEDVIAJAVA("invokedviajava"),
/**
* AIX only: known values: ON
*/
JAVA_ASSISTIVE("java.assistive"),
/**
* AIX only: known values:
*/
JAVA_AWT_FONTS("java.awt.fonts"),
/**
* AIX only: known values: 20090506
*/
JAVA_JCL_VERSION("java.jcl.version"),
/**
* AIX only: known values: java.util.prefs.FileSystemPreferencesFactory
*/
JAVA_UTIL_PREFS__PREFERENCES_FACTORY("java.util.prefs.PreferencesFactory"),
/**
* AIX only: known values: 9
*/
JXE_CURRENT_ROMIMAGE_VERSION("jxe.current.romimage.version"),
/**
* AIX only: known values: 9
*/
JXE_LOWEST_ROMIMAGE_VERSION("jxe.lowest.romimage.version"),
/**
* AIX only: known values:
*/
SUN_JAVA2D_FONTPATH("sun.java2d.fontpath"),