The System
class maintains a set of properties—key/value pairs—that define traits or attributes of the current working environment. When the Java application first starts up, the system properties are initialized with information about the runtime environment, including information about the current user, the current version of the Java runtime, and even the product vendor’s bug report URL.
This chapter describes the key system properties available with the Oracle JRockit JVM:
As described above, system properties are part of the
System class as defined by J2SE 1.4.2 and 5.0. You can obtain these properties in a Java class simply by calling the
getProperty()
method. Listing 4-1 shows how the getProperty()
method is used to get system properties.
String os_name = System.getProperty("os.name");
String os_arch = System.getProperty("os.arch");
String java_home = System.getProperty("java.home");
String java_vm_name = System.getProperty("java.vm.name");
This property identifies the J2SE JDK/JRE product vendor. This includes:
Oracle
This property identifies the J2SE JDK/JRE product vendor URL; for example:
This property identifies the J2SE JDK/JRE product vendor bug report URL. This includes:
This property identifies the J2SE JDK/JRE product version; that is, which version of the JDK or JSE you are running. The version number also appears on the first line of the output and is common to Sun JRE and Oracle JRockit JRE. The information generated by this property appears in this format:
<jdk_major_version>.<jdk_minor_version>.<jdk_micro_version>[_<jdk_update_version>][-<milestone>]
The value appears in bold in the example version output below:
java version"1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
BEA JRockit(R) (builddra-45238-20050523-2021-win-ia32, R25.2.0-28)
For more information on java.version
, please refer to:
This property identifies the J2SE JDK/JRE product version and build identifier. The value also appears on the second line of the java -version
output in the following format:
<jdk_major_version>.<jdk_minor_version>.<jdk_micro_version>[_<jdk_update_version>][-<milestone>]-<build_number>
The value appears in bold in the example version output below:
java version “1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.5.0_03-b07
)
BEA JRockit(R) (builddra-45238-20050523-2021-win-ia32, R25.2.0-28
)
This value is common to both the Sun JRE and JRockit JRE.
For more information, please refer to:
This property identifies the JVM implementation. It appears on the third line of java -version
output. Depending upon the JVM you are using, the VM name will appear as either:
The value appears in bold in the example version output below:
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)BEA JRockit(R)
(builddra-45238-20050523-2021-win-ia32, R25.2.0-28
This property identifies the JVM implementation vendor; for example:
This property identifies the JVM implementation vendor URL; for example:
This property identifies the JVM implementation version. The version ID appear on the third line of java -version
output. This ID is the main method to distinguish between JRockit JVM versions. Below are examples from a few different releases of the JRockit JVM
The value appears in bold in the example version output below:
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
BEA JRockit(R) (builddra-45238-20050523-2021-win-ia32
, R25.2.0-28)
This property identifies the version of the Java Virtual Machine specification upon which your JRockit JVM instance is based.
1.0
This property identifies the vendor of the Java Virtual Machine specification upon which your JRockit JVM instance is based.
Sun Microsystems Inc
This property identifies the name of the Java Virtual Machine specification upon which your JRockit JVM instance is based.
Java Virtual Machine Specifications
This property identifies the operating system. For the JRockit JVM, this includes:
Windows XP
For additional information on O/S support, please refer to Oracle JRockit JDK Supported Configurations at
This property identifies the operating system architecture. For Oracle JRockit JVM, this includes:
For additional information on supported architectures, please refer to Oracle JRockit JDK Supported Configurations at
This property identifies the operating system version. For example:
5.1
For additional information on O/S support, please refer to Oracle JRockit JDK Supported Configurations at