This chapter describes the key system properties available with the Oracle JRockit JVM.
The System
class maintains properties (key and value pairs) that define traits or attributes of the current working environment. When the Java application starts, the system properties are initialized with information about the run-time environment, including information about the current user, the current version of the Java run time, and so on.
This chapter describes the following properties:
System properties are part of the java.lang.System
class as defined by the Java specifications. For more information, see the specification for the java.lang.System
class at the following locations:
Java SE 6.0
J2SE 5.0
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html
You can obtain the properties in a Java class by calling the getProperty()
method as shown in Example 4-1.
Example 4-1 Obtaining 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");
The java.vendor
property identifies the JDK/JRE vendor.
The java.vendor.url
property identifies the URL of the JDK/JRE vendor.
HotSpot: http://java.sun.com/
JRockit: http://www.oracle.com/
The java.vendor.url.bug
property identifies the bug report URL of the JDK or JRE vendor.
HotSpot: http://java.sun.com/cgi-bin/bugreport.cgi
JRockit: http://download.oracle.com/docs/cd/E15289_01/go2troubleshooting.html
The java.version
property identifies the version of the JDK or JRE that you are running.
The value of the property is common to the HotSpot JRE and the JRockit JRE. It is displayed on the first line of the output of the java -version
command in the following format:
major_version.minor_version.micro_version[_update_version][-milestone]
The following example shows the output of the java -version
command. The java.version
information is highlighted.
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Oracle JRockit(R) (build R28.0.0-617-125986-1.6.0_17-20091215-2120-windows-x86_64, compiled mode)
For more information about the java.version
property, see the J2SE SDK/JRE Version String Naming Convention at:
http://java.sun.com/j2se/versioning_naming.html
The java.runtime.version
property identifies the Java SE JDK/JRE version and build.
The value of the property is common to the HotSpot JRE and the JRockit JRE. It is displayed on the second line of the output of the java -version
command in the following format:
major_version.minor_version.micro_version[_update_version][-milestone]-build
The following example shows the output of the java -version
command. The java.runtime.version
information is highlighted.
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Oracle JRockit(R) (build R28.0.0-617-125986-1.6.0_17-20091215-2120-windows-x86_64, compiled mode)
For more information about the java.runtime.version
property, see the J2SE SDK/JRE Version String Naming Convention at:
http://java.sun.com/j2se/versioning_naming.html
The java.vm.name
property identifies the JVM implementation. The value depends on the JVM you use:
HotSpot: Java HotSpot(TM) Client VM
or Java HotSpot(TM) Server VM
JRockit: Oracle JRockit(R)
The java.vm.name
information is displayed on the third line of the output of the java -version
command as highlighted in the following example:
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Oracle JRockit(R) (build R28.0.0-617-125986-1.6.0_17-20091215-2120-windows-x86_64, compiled mode)
The java.vm.vendor
property identifies the JVM implementation vendor.
The java.vm.vendor.url
property identifies the URL of the JVM implementation vendor.
HotSpot: http://java.sun.com/
JRockit: http://www.oracle.com/
The java.vm.version
property identifies the JVM implementation version. The version is displayed on the third line of the output of the java -version
command.
The java.vm.version
information is displayed on the third line of the output of the java -version
command, as highlighted in the following example:
java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b08) Oracle JRockit(R) (build R28.0.0-617-125986-1.6.0_17-20091215-2120-windows-x86_64, compiled mode)
The java.vm.version
property is the main means to distinguish between JRockit JVM releases. The following are examples of JVM implementation versions from a few different JRockit JVM releases:
R24.5.0: ari-49095-20050826-1856-win-ia32
5.0 SP2: dra-45238-20050523-2021-win-ia32
R26.4.0: R26.4.0-63-63688-1.5.0_06-20060626-2259-win-ia32
R27.3.1: R27.3.1-1-85830-1.6.0_01-20070716-1248-windows-ia32
R28.0.0: R28.0.0-615-125739-1.6.0_17-20091210-2122-windows-ia32
The java.vm.specification.version
property identifies the version of the JVM specification on which the JRockit JVM instance is based (example: 1.0
).
The java.vm.specification.vendor
property identifies the vendor of the JVM specification on which the JRockit JVM instance is based.
The java.vm.specification.name
property identifies the name of the specification on which the JRockit JVM instance is based (example: Java Virtual Machine Specifications
).
The os.name
property identifies the operating system. For the JRockit JVM, this includes Windows, Linux, and Solaris versions (example: Windows XP
).
For information about supported hardware and software configurations, see the Oracle JRockit JDK Supported Configurations at http://www.oracle.com/technology/software/products/ias/files/fusion_certification.html
.
The os.arch
property identifies the operating system architecture. For the JRockit JVM, this includes the following:
x86 on IA32 systems
amd64 on x86_64 systems
sparcv9 on SPARC systems
For more information, see Oracle JRockit JDK Supported Configurations on the Oracle Technology Network (OTN).
The os.version
property identifies the operating system version.
For more information about operating system support, see Oracle JRockit JDK Supported Configurations on the Oracle Technology Network (OTN).