IT. Expert System.

Java Standard Edition (SE)

Environment Variables and System Properties

Java Platform, Standard Edition HotSpot Virtual Machine Troubleshooting Guide
Contents    Previous    Next

A Environment Variables and System Properties

This appendix describes environment variables and system properties that can be useful for troubleshooting problems with the Java HotSpot VM.

"Submitting Bug Reports" contains information on collecting environment variables in "Environment Variables".

The JAVA_HOME Environment Variable

This variable indicates the directory where the Java Development Kit (JDK) software is installed.

The JAVA_TOOL_OPTIONS Environment Variable

In many environments the command line is not readily accessible to start the application with necessary command-line options. This often arises with applications that use embedded VMs (meaning they use the Java Native Interface (JNI) Invocation API to start the VM), or where the startup is deeply nested in scripts. In these environments the JAVA_TOOL_OPTIONS environment variable can be useful to augment a command line.

When this environment variable is set, the JNI_CreateJavaVM function (in the JNI Invocation API) prepends the value of the environment variable to the options supplied in its JavaVMInitArgs argument.


In some cases this option is disabled for security reasons (for example, on Solaris OS the option is disabled when the effective user or group ID differs from the real ID).

This environment variable allows you to specify the initialization of tools, specifically the launching of native or Java programming language agents using the -agentlib or -javaagent options. In the following example the environment variable is set so that the HPROF profiler is launched when the application is started:

$ export JAVA_TOOL_OPTIONS="-agentlib:hprof"

This variable can also be used to augment the command line with other options for diagnostic purposes. For example, you can supply the -XX:OnError option to specify a script or command to be executed when a fatal error occurs.

Since this environment variable is examined at the time the JNI_CreateJavaVM function is called, it cannot be used to augment the command line with options that would normally be handled by the launcher, for example, VM selection using the -client option or the -server option.

For more information on using the JAVA_TOOL_OPTIONS environment variable, see the "JAVA_TOOL_OPTIONS" section of the JVM Tool Interface documentation at

The System Property

This system property controls whether the security system of the Java Runtime Environment (JRE) prints trace messages during execution. This option can be useful when diagnosing an issue involving a security manager when a SecurityException is thrown.

The property can have the following values:


Print all checkPermission results.

The following additional options can be specified with the access option:


Include stack trace.


Dump all domains in context.


Before throwing an exception, dump the stack and domain that did not have permission.


Print JAR verification information.


Print policy information.


Print permissions that SecureClassLoader assigns.

For example, to print all checkPermission results and trace all domains in context, set the property to access,stack. To trace access failures, set the property to access,failure.

The following example shows the output of a checkPermission failure:

$ java"access,failure" MyApp
access denied ( resolve
java.lang.Exception: Stack trace
    at java.lang.Thread.dumpStack(
    at java.lang.SecurityManager.checkPermission(
    at java.lang.SecurityManager.checkConnect(
    at MyApp.main(

For more information on the system property, see the "Troubleshooting Security" section of the Java SE Security documentation at

Contents    Previous    Next


Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)





Java Script








Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 338 / 159525481. Delta: 0.03230 с