IBM 32-bit SDK for Windows platforms, Java Technology Edition

SDK and Runtime Guide

Version 6

Copyright International Business Machines Corporation 2003, 2010.
US Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

Contents

Preface
Overview
Version compatibility
Migrating from other IBM JVMs
Contents of the SDK and Runtime Environment
Contents of the Runtime Environment
Contents of the SDK
Installing and configuring the SDK and Runtime Environment
Before you install
Installing the packages
Attended (interactive) installation
Installing the Runtime Environment as the system Java Virtual Machine
Unattended installation
Enabling the IBM Accessibility Bridge
Disabling Java Accessibility support
Information for European language users
Setting the path
Setting the class path
Updating your SDK or JRE for daylight saving time changes
Uninstallation
Running Java applications
The java and javaw commands
Obtaining version information
Specifying Java options and system properties
Standard options
Globalization of the java command
Executing a Java file automatically
Running Java applications with native assistive technologies
The Just-In-Time (JIT) compiler
Disabling the JIT
Enabling the JIT
Determining whether the JIT is enabled
Specifying garbage collection policy
Garbage collection options
Increased heap sizes using a split heap
Pause time
Pause time reduction
Environments with very full heaps
Euro symbol support
Using Indian and Thai input methods
Developing Java applications
Using XML
Migrating to the XL-TXE-J
XML reference information
Debugging Java applications
Java Debugger (JDB)
Selective debugging
Determining whether your application is running on a 32-bit or 64-bit JVM
How the JVM processes signals
Signals used by the JVM
Linking a native code driver to the signal-chaining library
Writing JNI applications
Supported compilers
Configuring large page memory allocation
CORBA support
System properties for tracing the ORB
System properties for tuning the ORB
Java security permissions for the ORB
ORB implementation classes
RMI over IIOP
Implementing the Connection Handler Pool for RMI
Enhanced BigDecimal
Support for the Java Attach API
Plug-in, Applet Viewer and Web Start
Using the Java plug-in
Supported browsers
Installing the Java plug-in using the Java control panel
Secure Static Versioning (SSV) support
Common Document Object Model (DOM) support
Using DBCS parameters
Working with applets
Running and debugging applets with the Applet Viewer
Unique CLSIDs
Using Web Start
Running Web Start
WebStart Secure Static Versioning
Distributing Java applications
Class data sharing between JVMs
Overview of class data sharing
Class data sharing command-line options
Creating, populating, monitoring, and deleting a cache
Performance and memory consumption
Considerations and limitations of using class data sharing
Cache size limits
JVMTI RetransformClasses() is unsupported
Runtime bytecode modification
Operating system limitations
Using SharedClassPermission
Adapting custom classloaders to share classes
Java Communications API (JavaComm)
Installing Java Communications API from a compressed file
Configuring the Java Communications API
Specifying devices in the javax.comm.properties file
Printing limitation with the Java Communications API
Uninstalling Java Communications API
The Java Communications API documentation
Service and support for independent software vendors
Accessibility
Keyboard traversal of JComboBox components in Swing
Web Start accessibility
General note about security
Any comments on this user guide?
Appendix A. Command-line options
Specifying command-line options
General command-line options
System property command-line options
JVM command-line options
-XX command-line options
JIT and AOT command-line options
Garbage Collector command-line options
Appendix B. Known limitations
Notices
Trademarks

Preface

This user guide provides general information about the IBM® 32-bit SDK and Runtime Environment for Windows®, Java™ Technology Edition, Version 6. The user guide gives specific information about any differences in the IBM implementation compared with the Sun implementation.

Read this user guide with the more extensive documentation on the Sun Web site: http://java.sun.com.

The SDK and Runtime Environments are supported on the following products:

These Virtualized Environments are supported:

Note: IPv6 is not supported on Windows 2000.

The Diagnostics Guide provides more detailed information about the IBM Virtual Machine for Java.

This user guide is part of a release and is applicable only to that particular release. Make sure that you have the user guide appropriate to the release you are using.

The terms "Runtime Environment" and "Java Virtual Machine" are used interchangeably throughout this user guide.

Start of changeTechnical changes made for this version of the user guide, other than minor or obvious ones, are indicated by blue chevrons when viewing in an Information Center, by blue chevrons and in red when viewing in HTML, or by vertical bars to the left of the changes when viewing as a PDF file.End of change

The Program Code is not designed or intended for use in real-time applications such as (but not limited to) the online control of aircraft, air traffic, aircraft navigation, or aircraft communications; or in the design, construction, operation, or maintenance of any nuclear facility.

Overview

The IBM SDK is a development environment for writing and running applets and applications that conform to the Java 6 Core Application Program Interface (API).

The SDK includes the Runtime Environment for Windows, which enables you only to run Java applications. If you have installed the SDK, the Runtime Environment is included.

The Runtime Environment contains the Java Virtual Machine and supporting files including class files. The Runtime Environment contains only a subset of the classes that are found in the SDK and allows you to support a Java program at runtime but does not provide compilation of Java programs. The Runtime Environment for Windows does not include any of the development tools, for example appletviewer.exe or the Java compiler (javac.exe), or classes that are only for development systems.

In addition, the Java Communications application programming interface (API) package is provided for use with the Runtime Environment for Windows. You can find information about it in Java Communications API (JavaComm).

Version compatibility

In general, any applet or application that ran with a previous version of the SDK should run correctly with the IBM 32-bit SDK for Windows, v6. Classes compiled with this release are not guaranteed to work on previous releases.

The IBM 32-bit SDK for Windows, v6, is built with Microsoft Visual Studio .NET 2003.

For information about compatibility issues between releases, see the Sun Web site at:

http://java.sun.com/javase/6/webnotes/compatibility.html

http://java.sun.com/j2se/5.0/compatibility.html

http://java.sun.com/j2se/1.4/compatibility.html

http://java.sun.com/j2se/1.3/compatibility.html

If you are using the SDK as part of another product (for example, IBM WebSphere® Application Server), and you upgrade from a previous level of the SDK, perhaps v5.0, serialized classes might not be compatible. However, classes are compatible between service refreshes.

Migrating from other IBM JVMs

From Version 5.0, the IBM Runtime Environment for Windows contains new versions of the IBM Virtual Machine for Java and the Just-In-Time (JIT) compiler.

If you are migrating from an older IBM Runtime Environment, note that:

Contents of the SDK and Runtime Environment

The SDK contains several development tools and a Java Runtime Environment (JRE). This section describes the contents of the SDK tools and the Runtime Environment.

Applications written entirely in Java must have no dependencies on the IBM SDK's directory structure (or files in those directories). Any dependency on the SDK's directory structure (or the files in those directories) might result in application portability problems. Java Native Interface (JNI) applications will have some minor dependencies.

The user guides, Javadoc files, demo files, and the accompanying license and copyright files are the only documentation included in this SDK for Windows. You can view Sun's software documentation by visiting the Sun Web site, or you can download Sun's software documentation package from the Sun Web site: http://java.sun.com.

Contents of the Runtime Environment

A list of classes, tools, and other files that you can use with the standard Runtime Environment.

Contents of the SDK

A list of tools and reference information that is included with the standard SDK.

The following tools are part of the SDK and are located in the C:\Program Files\IBM\Java60\bin directory:
appletviewer.exe (Java Applet Viewer)
Tests and runs applets outside a Web browser.
apt.exe (Annotation Processing Tool)
Finds and executes annotation processors based on the annotations present in the set of specified source files being examined.
ControlPanel.exe (Java Control Panel)
Configures your Runtime Environment.
extcheck.exe (Extcheck utility)
Detects version conflicts between a target jar file and currently-installed extension jar files.
HtmlConverter.exe (Java Plug-in HTML Converter)
Converts an HTML page that contains applets to a format that can use the Java Plug-in.
idlj.exe (IDL to Java Compiler)
Generates Java bindings from a given IDL file.
ikeycmd.exe (iKeyman command-line utility)
Allows you to manage keys, certificates, and certificate requests from the command line. For more information see the accompanying Security Guide and http://www.ibm.com/developerworks/java/jdk/security/.
jar.exe (Java Archive Tool)
Combines multiple files into a single Java Archive (JAR) file.
jarsigner.exe (JAR Signing and Verification Tool)
Generates signatures for JAR files and verifies the signatures of signed JAR files.
java.exe (Java Interpreter)
Runs Java classes. The Java Interpreter runs programs that are written in the Java programming language.
java-rmi.exe (HTTP-to-CGI request forward tool)
Accepts RMI-over-HTTP requests and forwards them to an RMI server listening on any port.
javac.exe (Java Compiler)
Compiles programs that are written in the Java programming language into bytecodes (compiled Java code).
javadoc.exe (Java Documentation Generator)
Generates HTML pages of API documentation from Java source files.
javah.exe (C Header and Stub File Generator)
Enables you to associate native methods with code written in the Java programming language.
javap.exe (Class File Disassembler)
Disassembles compiled files and can print a representation of the bytecodes.
javaw.exe (Java Interpreter)
Runs Java classes in the same way as the java command does, but does not use a console window.
javaws.exe (Java Web Start)
Enables the deployment and automatic maintenance of Java applications. For more information, see Running Web Start.
jconsole.exe (JConsole Monitoring and Management Tool)
Monitors local and remote JVMs using a GUI. JMX-compliant.
jdb.exe (Java Debugger)
Helps debug your Java programs.
jdmpview.exe (Cross-platform dump formatter)
Analyzes dumps. For more information, see the Diagnostics Guide.
keytool.exe (Key and Certificate Management Tool)
Manages a keystore (database) of private keys and their associated X.509 certificate chains that authenticate the corresponding public keys.
native2ascii.exe (Native-To-ASCII Converter)
Converts a native encoding file to an ASCII file that contains characters encoded in either Latin-1 or Unicode, or both.
packager.exe (JavaBean to ActiveX packager)
Packages a JavaBean in a jar file for use as an ActiveX control.
policytool.exe (Policy File Creation and Management Tool)
Creates and modifies the external policy configuration files that define your installation's Java security policy.
rmic.exe (Java Remote Method Invocation (RMI) Stub Converter)
Generates stubs, skeletons, and ties for remote objects. Includes RMI over Internet Inter-ORB Protocol (RMI-IIOP) support.
rmid.exe (RMI activation system daemon)
Starts the activation system daemon so that objects can be registered and activated in a Java virtual machine (JVM).
rmiregistry.exe (Java remote object registry)
Creates and starts a remote object registry on the specified port of the current host.
schemagen.exe
Creates a schema file for each namespace referenced in your Java classes.
serialver.exe (Serial Version Command)
Returns the serialVersionUID for one or more classes in a format that is suitable for copying into an evolving class.
tnameserv.exe (Common Object Request Broker Architecture (CORBA) transient naming service)
Starts the CORBA transient naming service.
wsgen.exe
Generates JAX-WS portable artifacts used in JAX-WS Web services.
wsimport.exe
Generates JAX-WS portable artifacts from a Web Services Description Language (WSDL) file.
xjc.exe
Compiles XML Schema files.
Include Files
C headers for JNI programs.
copyright
The copyright notice for the SDK for Windows software.
License

The License file, C:\Program Files\IBM\Java60\docs\content\<locale>\LA_<locale>, contains the license agreement for the SDK for Windows software (where <locale> is the name of your locale, for example en). To view or print the license agreement, open the file in a Web browser.

Installing and configuring the SDK and Runtime Environment

Use the installation wizard or the compressed file to install the SDK. Configure the SDK using environment variables, command-line options, and properties files.

Before you install

To install the SDK or the Runtime Environment package, download the relevant installation package. Ensure that you download all packages to the same directory and that there is enough space in your temporary directory.

The packages and their file names are listed in Installing the packages; do not change the packages' file names.

Before you begin to install, ensure that there is enough space in your C:\WINDOWS\TEMP directory to use during installation. The amount of temporary space required in the TEMP directory during installation is:

If you do not have enough temporary space, the installation program generates an error and terminates the installation. If you do have enough temporary space but still see this message, verify that the packages you are attempting to install were downloaded completely. You can do this by comparing the file sizes of your packages to the file sizes shown on the Web pages from which you downloaded the packages.

Installing the packages

There are many packages you can install independently, including the SDK, the Runtime Environment, Javacomm, documentation, and demos.

The packages you can install are:

Other packages are provided as compressed files:

If you install the SDK or Runtime Environment from the compressed package, you cannot use the Java plug-in.

If you install the SDK or Runtime Environment on a mapped (network) drive, the control panel icon will not be available in the Windows control panel. Installation on a mapped (network) drive is not supported.

Attended (interactive) installation

Use the attended installation to install the SDK or JRE on a single client.

Procedure

  1. Run ibm-java-sdk-60-win-i386.exe (for the SDK) or ibm-java-jre-60-win-i386.exe (for the Runtime Environment only).
  2. Follow the instructions in the installation wizard.

    The Runtime Environment is installed by default in the directory C:\Program Files\IBM\Java60\jre.

    If you downloaded the SDK installable package, you can choose which components to install:

    In the installation wizard, you are presented with the following options:

    Start of changeOn Windows Vista, Windows Server 2008 R2 and Windows 7 you cannot select Internet Explorer in the Browser Registration screen. This option is not available, and is greyed by default.End of change

    On Windows Vista, there might be a delay after selecting the installation language.

    If the installation fails with the error message "Error applying transform", the Windows Installer configuration information has become corrupted. To fix the error, use the Windows Installer Cleanup Utility from http://support.microsoft.com/kb/290301 to remove the corrupted Windows Installer configuration information.

Installing the Runtime Environment as the system Java Virtual Machine

When you install the Runtime Environment (either as part of the SDK installable package or from the Runtime Environment installable package), you are asked whether you want to install the Runtime Environment as the system Java Virtual Machine (JVM). If you do install it as the system JVM, the installation program copies the java.exe, javacpl.cpl, javaws.exe, and javaw.exe launchers into the Windows system directory.

If a version of java.exe or javaw.exe currently exists in the Windows system directory, you are prompted to overwrite the existing version with the current version. Installing these files into the Windows system directory makes this Runtime Environment the default JVM for the system. In addition, the "Current Version" registry key is set to match this installation.

Note: Installing the Runtime Environment as the system JVM copies only java.exe, javaws.exe, and javaw.exe into the Windows system directory. No other programs (such as javac.exe or appletviewer.exe) are copied.

Unattended installation

Use the unattended installation to install the SDK or JRE on multiple clients.

To create an unattended installation, you must first complete an attended installation and create a response file (setup.iss) that records the choices you made during installation. The response file you create must be correct for the computers on which you plan to use it. If necessary, create several response files to use for installing the packages on computers that have different configurations.

To create a response file while running the installation, at a command prompt type:

ibm-java-sdk-60-win-i386 /r

or

ibm-java-jre-60-win-i386 /r

Depending on your Windows product, a response file (setup.iss) is created in either the C:\Windows or C:\Winnt directory.

The following message might occur during an interactive installation:

Another Java Runtime Environment is currently
installed as the System JVM. Select Yes to
overwrite this version or No to exit this
installation.

If this message is displayed, click No and exit from the installation. Go to the Windows system directory and delete the following two files:

After you have deleted the files, restart the interactive installation using the command shown at the beginning of this section.

On the system on which you will run the unattended installation, copy the setup.iss response file to the C:\Windows directory. After you have copied the file, at a command prompt type:

ibm-java-sdk-60-win-i386 /s /f1c:\Windows\setup.iss /f2c:\setup.log
ibm-java-jre-60-win-i386 /s /f1c:\Windows\setup.iss /f2c:\setup.log
Note:
  1. There are no spaces after /f1 or /f2.
  2. The /f1 flag specifies the name and location of the response file. The /f2 flag specifies the name and location of the log file.

If the installation is successful, the log file contains the string ResultCode=0. If the installation is not successful, the log file will contain a different result code.

Enabling the IBM Accessibility Bridge

The IBM Accessibility Bridge is installed but disabled by default. To enable the IBM Accessibility Bridge, uncomment the assistive_technologies entry in the Accessibility.properties file.

About this task

The Accessibility.properties file is in the jre/lib directory. Delete the # from the beginning of the following line:

#assistive_technologies=JawBridge

This Web site tells you more about the Accessibility Utilities:

http://java.sun.com/products/jfc/accessibility.html

Disabling Java Accessibility support

You can disable Java Accessibility support to improve the JVM loading performance of Java applications that do not provide Java assistive technology support, especially over network links. To disable Java Accessibility support, set the JAVA_ASSISTIVE environment variable to OFF.

About this task

An assistive technology, such as JawBridge, is not available if this environment variable is set to OFF, even if the technology is enabled in the Accessibility.properties file.

Information for European language users

In Windows, a process has two codepages: the ANSI (or Windows) code page and the OEM (or DOS) code page. The javaw command always uses the ANSI code page unless the console.encoding system property is set.

The command window typically uses the OEM code page. Java console output uses the code page of the command window from which Java is started. However, the javaw command always uses the ANSI code page. You specify the code page to use for console output with the -Dconsole.encoding option on the java or javaw launcher. For example, -Dconsole.encoding=Cp1252 causes all console output to be in the Windows ANSI Latin1 code page (1252).

Setting the path

If you alter the PATH environment variable, you will override any existing Java launchers in your path.

About this task

The PATH environment variable enables Windows to find programs and utilities, such as javac, java, and javadoc tool, from any current directory. To display the current value of your PATH, type the following at a command prompt:

echo %PATH%

To add the Java launchers to your path:

  1. If you installed the SDK or Runtime Environment in C:\Program Files\IBM\Java60\ add the following directories to the PATH environment variable:
  2. Close and reopen any command prompt windows to activate the new PATH environment variable.

Results

After setting the path, you can run a tool by typing its name at a command prompt from any directory. For example, to compile the file Myfile.Java, at a command prompt, type:

javac Myfile.Java

Setting the class path

The class path tells the SDK tools, such as java, javac, and the javadoc tool, where to find the Java class libraries.

About this task

You should set the class path explicitly only if:

To display the current value of your CLASSPATH environment variable, type the following command at a command prompt:

  echo %CLASSPATH%

If you develop and run applications that use different runtime environments, including other versions that you have installed separately, you must set the CLASSPATH and PATH explicitly for each application. If you run multiple applications simultaneously and use different runtime environments, each application must run in its own command prompt.

Updating your SDK or JRE for daylight saving time changes

You can apply recent changes to daylight saving time using the IBM Time Zone Update Utility for Java (JTZU).

About this task

Many countries around the world use a daylight saving time (DST) convention. Typically, clocks move forward by one hour during the summer months to create more daylight hours during the afternoon and less during the morning. This practice has many implications, including the need to adjust system clocks in computer systems. Occasionally, countries change their DST start and end dates. These changes can affect the date and time functions in applications, because the original start and end dates are programmed into the operating system and in Java software. To avoid this problem you must update operating systems and Java installations with the new DST information.

The Olson time zone database is an external resource that compiles information about the time zones around the world. This database establishes standard names for time zones, such as "America/New_York", and provides regular updates to time zone information that can be used as reference data. To ensure that Java JREs and SDKs contain up to date DST information, IBM incorporates the latest Olson update into each Java service refresh. To find out which Olson time zone update is included for a particular service refresh, see https://www.ibm.com/developerworks/java/jdk/dst/olson_table.html.

If a DST change has been introduced since the last service refresh, you can use JTZU to directly update your Java installation. You can also use this tool to update your installation if you are unable to move straight to the latest service refresh. JTZU is available from IBM developerWorks® using the following link: https://www.ibm.com/developerworks/java/jdk/dst/jtzu.html.

Results

After updating your Java installation with any recent DST changes, your application can handle time and date calculations correctly.

Uninstallation

Use the Windows Add/Remove programs utility to uninstall the SDK or Runtime Environment.

Procedure

  1. Double-click My Computer on the Windows desktop.
  2. Double-click Control Panel.
  3. Double-click Add/Remove Programs.
  4. Click IBM 32-bit SDK for Java v6 in the list, and then click Change/Remove.
  5. Click OK.

Results

This procedure removes all of the packages that are installed with the Installer. It does not remove the Java Communications API package (see Uninstalling Java Communications API) or any additional files that have been extracted from the compressed packages.

Warning messages might be displayed notifying you that not all files, or registry entries, or both, were removed. These warnings are issued because Windows believes that certain files are still in use; these files, or registry entries, or both, will be removed when your system is next restarted.

If you do not have the required permissions to uninstall the SDK or Runtime Environment, "Error1325.launchpad is not a valid short file name". To uninstall the SDK or Runtime Environment, restore the correct permissions.

What to do next

If you uninstall version 1.3.1 or below while the IBM 32-bit SDK for Windows, v6 is still installed on the system, the uninstaller removes the following registry keys, and all the subkeys, that are required by the v6 installation:

Reinstall v6 after uninstalling version 1.3.1 or below. This uninstaller limitation has been fixed for version 1.4.0 and above.

Running Java applications

Java applications can be started using the java launcher or through JNI. Settings are passed to a Java application using command-line arguments, environment variables, and properties files.

The java and javaw commands

An overview of the java and javaw commands.

Purpose

The java and javaw tools start a Java application by starting a Java Runtime Environment and loading a specified class.

The javaw command is identical to java, except that javaw has no associated console window. Use javaw when you do not want a command prompt window to be displayed. The javaw launcher displays a window with error information if it fails.

Usage

The JVM searches for the initial class (and other classes that are used) in three sets of locations: the bootstrap class path, the installed extensions, and the user class path. The arguments that you specify after the class name or jar file name are passed to the main function.

The java and javaw commands have the following syntax:

java [ options ] <class> [ arguments ... ]
java [ options ] -jar <file.jar> [ arguments ... ]
javaw [ options ] <class> [ arguments ... ]
javaw [ options ] -jar <file.jar> [ arguments ... ]

Parameters

[options]
Command-line options to be passed to the runtime environment.
<class>
Startup class. The class must contain a main() method.
<file.jar>
Name of the jar file to start. It is used only with the -jar option. The named jar file must contain class and resource files for the application, with the startup class indicated by the Main-Class manifest header.
[arguments ...]
Command-line arguments to be passed to the main() function of the startup class.

Obtaining version information

You obtain The IBM build and version number for your Java installation using the -version option. You can also obtain version information for all jar files on the class path by using the -Xjarversion option.

Procedure

  1. Open a command prompt.
  2. Type the following command:
    java -version
    You will see information similar to:
    java version "1.6.0-internal"
    Java(TM) SE Runtime Environment (build 20070227_01)
    IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 Windows XP x86-32 jvmwi3260-20070226_11758 (JIT enabled)
    J9VM - 20070226_11758_lHdSMR
    JIT  - dev_20070215_1800
    GC   - 20070208_AA)
    Exact build dates and versions will change.

What to do next

You can also list the version information for all available jar files on the class path, the boot class path, and in the extensions directory. Type the following command:

java -Xjarversion

You will see information similar to:

...
C:\Program Files\IBM\Java60\jre\lib\ext\ibmpkcs11impl.jar  VERSION: 1.0 build_20070125
C:\Program Files\IBM\Java60\jre\lib\ext\dtfjview.jar
C:\Program Files\IBM\Java60\jre\lib\ext\xmlencfw.jar  VERSION: 1.00, 20061011  LEVEL: -20061011

...

The information available varies for each jar file and is taken from the Implementation-Version and Build-Level properties in the manifest of the jar file.

Specifying Java options and system properties

You can specify Java options and system properties on the command line, by using an options file, or by using an environment variable.

About this task

These methods of specifying Java options are listed in order of precedence. Rightmost options on the command line have precedence over leftmost options; for example, if you specify:

java -Xint -Xjit myClass

The -Xjit option takes precedence.

Procedure

  1. By specifying the option or property on the command line. For example:
    java -Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump MyJavaClass
  2. By creating a file that contains the options, and specifying it on the command line using -Xoptionsfile=<file>.
  3. By creating an environment variable called IBM_JAVA_OPTIONS containing the options. For example:
    set IBM_JAVA_OPTIONS="-Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump"

Standard options

The definitions for the standard options.

See JVM command-line options for information about nonstandard (-X) options.

-agentlib:<libname>[=<options>]
Loads a native agent library <libname>; for example -agentlib:hprof. For more information, specify -agentlib:jdwp=help and -agentlib:hprof=help on the command line.
-agentpath:libname[=<options>]
Loads a native agent library by full path name.
-cp <directories and .zip or .jar files separated by ;>
Sets the search path for application classes and resources. If -classpath and -cp are not used and the CLASSPATH environment variable is not set, the user class path is, by default, the current directory (.).
-classpath <directories and .zip or .jar files separated by ;>
Sets the search path for application classes and resources. If -classpath and -cp are not used and the CLASSPATH environment variable is not set, the user class path is, by default, the current directory (.).
-D<property name>=<value>
Sets a system property.
-help or -?
Prints a usage message.
-javaagent:<jarpath>[=<options>]
Load a Java programming language agent. For more information, see the java.lang.instrument API documentation.
-jre-restrict-search
Include user private JREs in the version search.
-no-jre-restrict-search
Exclude user private JREs in the version search.
-showversion
Prints product version and continues.
-verbose:<option>[,<option>...]
Enables verbose output. Separate multiple options using commas. The available options are:
class
Writes an entry to stderr for each class that is loaded.
gc
Writes verbose garbage collection information to stderr. Use -Xverbosegclog (see Garbage Collector command-line options for more information) to control the output. See the Diagnostics Guide for more information.
jni
Writes information to stderr describing the JNI services called by the application and JVM.
sizes
Writes information to stderr describing the active memory usage settings.
stack
Writes information to stderr describing the Java and C stack usage for each thread.
-version
Prints product version.
-version:<value>
Requires the specified version to run, for example "1.5".
-X
Prints help on nonstandard options.

Globalization of the java command

The java and javaw launchers accept arguments and class names containing any character that is in the character set of the current locale. You can also specify any Unicode character in the class name and arguments by using Java escape sequences.

To do this, use the -Xargencoding command-line option.

-Xargencoding
Use argument encoding. To specify a Unicode character, use escape sequences in the form \u####, where # is a hexadecimal digit (0 to 9, A to F).
-Xargencoding:utf8
Use UTF8 encoding.
-Xargencoding:latin
Use ISO8859_1 encoding.

For example, to specify a class called HelloWorld using Unicode encoding for both capital letters, use this command:

java -Xargencoding '\u0048ello\u0057orld'

The java and javaw commands provide translated messages. These messages differ based on the locale in which Java is running. The detailed error descriptions and other debug information that is returned by java is in English.

Executing a Java file automatically

To set a Java class or jar file to start automatically from the Windows explorer, use the Tools -> Folder Options -> File Type option of Windows Explorer.

About this task

Alternatively, at a command prompt type:

assoc .class=javaclass 
ftype javaclass=C:\Program Files\IBM\Java60\jre\bin\java.exe''%l''%*'

Note:
  1. The %l is the number 1 and not the letter l.
  2. If your Java is installed in a directory other than C:\Program Files\IBM\Java60\, substitute your installation directory.

Running Java applications with native assistive technologies

Sun provides the Java Access Bridge to give native Windows assistive technologies, such as screen readers, access to the Java Accessibility support in a Java application. These native Windows assistive technologies must support calls to the Java Access Bridge.

The Java Access Bridge available from Sun includes an installer, which places five files in the correct directories: access-bridge.jar, jaccess.jar, accessibility.properties, JavaAccessBridge.dll and WindowsAccessBridge.dll. IBM ships a copy of jaccess.jar in the appropriate directory for use with JawBridge.

If you have already enabled the IBM Accessibility Bridge (JawBridge), which allows the Windows 2000 Magnifier to function with Swing applications, and you want to enable JawBridge at the same time as the Java Access Bridge, edit the line in the accessibility.properties file to read:

assistive_technologies=com.sun.java.accessibility.AccessBridge,JawBridge

Comment out the line by inserting a leading # to deactivate both bridges. This Web site tells you how to how to download the Java Access Bridge:

http://java.sun.com/products/jfc/accessibility.html.

The Just-In-Time (JIT) compiler

The IBM Just-In-Time (JIT) compiler dynamically generates machine code for frequently used bytecode sequences in Java applications and applets during their execution. The JIT v6 compiler delivers new optimizations as a result of compiler research, improves optimizations implemented in previous versions of the JIT, and provides better hardware exploitation.

The JIT is included in both the IBM SDK and Runtime Environment, which is enabled by default in user applications and SDK tools. Typically, you do not start the JIT explicitly; the compilation of Java bytecode to machine code occurs transparently. You can disable the JIT to help isolate a problem. If a problem occurs when executing a Java application or an applet, you can disable the JIT to help isolate the problem. Disabling the JIT is a temporary measure only; the JIT is required to optimize performance.

For more information about the JIT, see the Diagnostics Guide.

Disabling the JIT

The JIT can be disabled in a number of different ways. Both command-line options override the JAVA_COMPILER environment variable.

About this task

Turning off the JIT is a temporary measure that can help isolate problems when debugging Java applications.

Procedure

Enabling the JIT

The JIT is enabled by default. You can explicitly enable the JIT in a number of different ways. Both command-line options override the JAVA_COMPILER environment variable.

Procedure

Determining whether the JIT is enabled

You can determine the status of the JIT using the -version option.

Procedure

Run the java launcher with the -version option. Enter the following at a command prompt:

java -version


If the JIT is not in use, a message is displayed that includes the following:

(JIT disabled)

If the JIT is in use, a message is displayed that includes the following:

(JIT enabled)

What to do next

For more information about the JIT, see the Diagnostics Guide.

Specifying garbage collection policy

The Garbage Collector manages the memory used by Java and by applications running in the JVM.

When the Garbage Collector receives a request for storage, unused memory in the heap is set aside in a process called "allocation". The Garbage Collector also checks for areas of memory that are no longer referenced, and releases them for reuse. This is known as "collection".

The collection phase can be triggered by a memory allocation fault, which occurs when no space is left for a storage request, or by an explicit System.gc() call.

Garbage collection can significantly affect application performance, so the IBM virtual machine provides various methods of optimizing the way garbage collection is carried out, potentially reducing the effect on your application.

For more detailed information about garbage collection, see the Diagnostics Guide.

Garbage collection options

The -Xgcpolicy options control the behavior of the Garbage Collector. They make trade-offs between throughput of the application and overall system, and the pause times that are caused by garbage collection.

The format of the option and its values is:

-Xgcpolicy:optthruput
(Default and recommended value.) Delivers very high throughput to applications, but at the cost of occasional pauses.
-Xgcpolicy:optavgpause
Reduces the time spent in garbage collection pauses and limits the effect of increasing heap size on the length of the garbage collection pause. Use optavgpause if your configuration has a very large heap.
-Xgcpolicy:gencon
Requests the combined use of concurrent and generational GC to help minimize the time that is spent in any garbage collection pause.

Increased heap sizes using a split heap

Many Java application workloads depend on the Java heap size. The IBM SDK for Java can use a split heap to work around restrictions in the Windows memory space and provide a larger maximum heap size.

By default, the IBM SDK for Java uses a contiguous Java heap to store Java objects. Using the -Xgc:splitheap command-line option splits the heap into multiple contiguous memory areas. The use of two areas can increase the maximum allocatable heap size.

The -Xgc:splitheap option also forces the use of the "gencon" (generational concurrent) garbage collection policy.

Use -Xgc:splitheap for applications that must run on the 32-bit JVM (because of 32-bit JNI libraries, a 32-bit operating system, or 32-bit hardware) but need large Java heaps.

-Xgc:splitheap is not recommended if your application works in the any of the following ways:

See the Diagnostics Guide for more detailed information about a split Java heap.

Pause time

When an application's attempt to create an object cannot be satisfied immediately from the available space in the heap, the Garbage Collector is responsible for identifying unreferenced objects (garbage), deleting them, and returning the heap to a state in which the immediate and subsequent allocation requests can be satisfied quickly.

Such garbage collection cycles introduce occasional unexpected pauses in the execution of application code. Because applications grow in size and complexity, and heaps become correspondingly larger, this garbage collection pause time tends to grow in size and significance.

The default garbage collection value, -Xgcpolicy:optthruput, delivers very high throughput to applications, but at the cost of these occasional pauses, which can vary from a few milliseconds to many seconds, depending on the size of the heap and the quantity of garbage.

Pause time reduction

The JVM uses two techniques to reduce pause times: concurrent garbage collection and generational garbage collection.

The -Xgcpolicy:optavgpause command-line option requests the use of concurrent garbage collection to reduce significantly the time that is spent in garbage collection pauses. Concurrent GC reduces the pause time by performing some garbage collection activities concurrently with normal program execution to minimize the disruption caused by the collection of the heap. The -Xgcpolicy:optavgpause option also limits the effect of increasing the heap size on the length of the garbage collection pause. The -Xgcpolicy:optavgpause option is most useful for configurations that have large heaps. With the reduced pause time, you might experience some reduction of throughput to your applications.

During concurrent garbage collection, a significant amount of time is wasted identifying relatively long-lasting objects that cannot then be collected. If garbage collection concentrates on only the objects that are most likely to be recyclable, you can further reduce pause times for some applications. Generational GC reduces pause times by dividing the heap into two generations: the "new" and the "tenure" areas. Objects are placed in one of these areas depending on their age. The new area is the smaller of the two and contains new objects; the tenure is larger and contains older objects. Objects are first allocated to the new area; if they have active references for long enough, they are promoted to the tenure area.

Generational GC depends on most objects not lasting long. Generational GC reduces pause times by concentrating the effort to reclaim storage on the new area because it has the most recyclable space. Rather than occasional but lengthy pause times to collect the entire heap, the new area is collected more frequently and, if the new area is small enough, pause times are comparatively short. However, generational GC has the drawback that, over time, the tenure area might become full. To minimize the pause time when this situation occurs, use a combination of concurrent GC and generational GC. The -Xgcpolicy:gencon option requests the combined use of concurrent and generational GC to help minimize the time that is spent in any garbage collection pause.

Environments with very full heaps

If the Java heap becomes nearly full, and very little garbage can be reclaimed, requests for new objects might not be satisfied quickly because no space is immediately available.

If the heap is operated at near-full capacity, application performance might suffer regardless of which garbage collection options are used; and, if requests for more heap space continue to be made, the application might receive an OutOfMemoryError, which results in JVM termination if the exception is not caught and handled. At this point, the JVM produces a Javadump file for use during diagnostics. In these conditions, you are recommended either to increase the heap size by using the -Xmx option or to reduce the number of objects in use.

For more information, see the Diagnostics Guide.

Euro symbol support

The IBM SDK and Runtime Environment set the Euro as the default currency for those countries in the European Monetary Union (EMU) for dates on or after 1 January, 2002. From 1 January 2008, Cyprus and Malta also have the Euro as the default currency.

To use the old national currency, specify -Duser.variant=PREEURO on the Java command line.

If you are running the UK, Danish, or Swedish locales and want to use the Euro, specify -Duser.variant=EURO on the Java command line.

Using Indian and Thai input methods

From Version 6, the Indian and Thai input methods are not available by default. You must manually include the input method jar files in your Java extensions path to use the Indian and Thai input methods.

About this task

In Version 5.0, the input method jar files were included in the jre\lib\ext directory and were automatically loaded by the JVM. In Version 6, the input method jar files are included in the jre\lib\im directory and you must manually add them to the Java extensions path to enable Indian and Thai input methods.

Procedure

What to do next

If you installed the SDK or Runtime Environment in a different directory, replace C:\Program Files\IBM\Java60\ with the directory in which you installed the SDK or Runtime Environment.

Developing Java applications

The SDK for Windows contains many tools and libraries required for Java software development.

See Contents of the SDK for details of the tools available.

Using XML

The IBM SDK contains the XML4J and XL XP-J parsers, the XL TXE-J 1.0 XSLT compiler, and the XSLT4J XSLT interpreter. These tools allow you to parse, validate, transform, and serialize XML documents independently from any given XML processing implementation.

Use factory finders to locate implementations of the abstract factory classes, as described in Selecting an XML processor. By using factory finders, you can select a different XML library without changing your Java code.

Available XML libraries

The IBM SDK for Java contains the following XML libraries:

XML4J 4.5

XML4J is a validating parser providing support for the following standards:

XML4J 4.5 is based on Apache Xerces-J 2.9.0. See http://xerces.apache.org/xerces2-j/ for more information.

XL XP-J 1.1

XL XP-J 1.1 is a high-performance non-validating parser that provides support for StAX 1.0 (JSR 173). StAX is a bidirectional API for pull-parsing and streaming serialization of XML 1.0 and XML 1.1 documents. See the XL XP-J reference information section for more details about what is supported by XL XP-J 1.1.

XL TXE-J 1.0.1 Beta

For Version 5.0, the IBM SDK for Java included the XSLT4J compiler and interpreter. The XSLT4J interpreter was used by default.

For Version 6, the IBM SDK for Java includes XL TXE-J. XL TXE-J includes the XSLT4J 2.7.8 interpreter and a new XSLT compiler. The new compiler is used by default. The XSLT4J compiler is no longer included with the IBM SDK for Java. See Migrating to the XL-TXE-J for information about migrating to XL TXE-J.

XL TXE-J provides support for the following standards:

Selecting an XML processor

XML processor selection is performed using service providers. When using a factory finder, Java looks in the following places, in this order, to see which service provider to use:

  1. The system property with the same name as the service provider.
  2. The service provider specified in a properties file.
  3. The contents of the META-INF\services\<service.provider> file.
  4. The default service provider.

The following service providers control the XML processing libraries used by Java:

javax.xml.parsers.SAXParserFactory
Selects the SAX parser. By default, org.apache.xerces.jaxp.SAXParserFactoryImpl from the XML4J library is used.
javax.xml.parsers.DocumentBuilderFactory
Selects the document builder. By default, org.apache.xerces.jaxp.DocumentBuilderFactoryImpl from the XML4J library is used.
javax.xml.datatype.DatatypeFactory
Selects the datatype factory. By default, org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl from the XML4J library is used.
javax.xml.stream.XMLEventFactory
Selects the StAX event factory. By default, com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl from the XL XP-J library is used.
javax.xml.stream.XMLInputFactory
Selects the StAX parser. By default, com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl from the XL XP-J library is used.
javax.xml.stream.XMLOutputFactory
Selects the StAX serializer. By default, com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl from the XL XP-J library is used.
javax.xml.transform.TransformerFactory
Selects the XSLT processor. Possible values are:
com.ibm.xtq.xslt.jaxp.compiler.TransformerFactoryImpl
Use the XL TXE-J compiler. This value is the default.
org.apache.xalan.processor.TransformerFactoryImpl
Use the XSLT4J interpreter.
javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema
Selects the schema factory for the W3C XML Schema language. By default, org.apache.xerces.jaxp.validation.XMLSchemaFactory from the XML4J library is used.
javax.xml.xpath.XPathFactory
Selects the XPath processor. By default, org.apache.xpath.jaxp.XPathFactoryImpl from the XSLT4J library is used.

Migrating to the XL-TXE-J

The XL TXE-J compiler has replaced the XSLT4J interpreter as the default XSLT processor. Follow these steps to prepare your application for the new library.

About this task

The XL TXE-J compiler is faster than the XSLT4J interpreter when you are applying the same transformation more than once. If you perform each individual transformation only once, the XL TXE-J compiler is slower than the XSLT4J interpreter because compilation and optimization reduce performance.

To continue using the XSLT4J interpreter as your XSLT processor, set the javax.xml.transform.TransformerFactory service provider to org.apache.xalan.processor.TransformerFactoryImpl.

To migrate to the XL-TXE-J compiler, follow the instructions in this task.

Procedure

  1. Use com.ibm.xtq.xslt.jaxp.compiler.TransformerFactoryImpl when setting the javax.xml.transform.TransformerFactory service provider.
  2. Regenerate class files generated by the XSLT4J compiler. XL TXE-J cannot execute class files generated by the XSLT4J compiler.
  3. Some methods generated by the compiler might exceed the JVM method size limit, in which case the compiler attempts to split these methods into smaller methods. To set the split limit, use the -SPLITLIMIT option when using the Process or Compile commands, or the http://www.ibm.com/xmlns/prod/xltxe-j/split-limit transformer factory attribute when using the transformer factory. The split limit can be between 100 and 2000. When setting the split limit manually, use the highest split limit possible for best performance.
  4. XL TXE-J might need more memory than the XSLT4J compiler. If you are running out of memory or performance seems slow, increase the size of the heap using the -Xmx option.
  5. Migrate your application to use the new attribute keys. The old transformer factory attribute keys are deprecated. The old names are accepted with a warning.
    Table 1. Changes to attribute keys from the XSL4J compiler to the XL TXE-J compiler
    XSL4J compiler attribute XL TXE-J compiler attribute
    translet-name http://www.ibm.com/xmlns/prod/xltxe-j/translet-name
    destination-directory http://www.ibm.com/xmlns/prod/xltxe-j/destination-directory
    package-name http://www.ibm.com/xmlns/prod/xltxe-j/package-name
    jar-name http://www.ibm.com/xmlns/prod/xltxe-j/jar-name
    generate-translet http://www.ibm.com/xmlns/prod/xltxe-j/generate-translet
    auto-translet http://www.ibm.com/xmlns/prod/xltxe-j/auto-translet
    use-classpath http://www.ibm.com/xmlns/prod/xltxe-j/use-classpath
    debug http://www.ibm.com/xmlns/prod/xltxe-j/debug
    indent-number http://www.ibm.com/xmlns/prod/xltxe-j/indent-number
    enable-inlining Obsolete in new compiler
  6. Optional: For best performance, ensure that you are not recompiling XSLT transformations that can be reused. Use one of the following methods to reuse compiled transformations:

XML reference information

The XL XP-J and XL TXE-J XML libraries are new for Version 6 of the SDK. This reference information describes the features supported by these libraries.

XL XP-J reference information

XL XP-J 1.1 is a high-performance non-validating parser that provides support for StAX 1.0 (JSR 173). StAX is a bidirectional API for pull-parsing and streaming serialization of XML 1.0 and XML 1.1 documents.

Unsupported features

The following optional StAX features are not supported by XL XP-J:

XMLInputFactory reference

The javax.xml.stream.XMLInputFactory implementation supports the following properties, as described in the XMLInputFactory Javadoc information: http://java.sun.com/javase/6/docs/api/javax/xml/stream/XMLInputFactory.html.

Property name Supported?
javax.xml.stream.isValidating No. The XL XP-J scanner does not support validation.
javax.xml.stream.isNamespaceAware Yes, supports true and false. For XMLStreamReaders created from DOMSources, namespace processing depends on the methods that were used to create the DOM tree, and this value has no effect.
javax.xml.stream.isCoalescing Yes
javax.xml.stream.isReplacingEntityReferences Yes. For XMLStreamReaders created from DOMSources, if entities have already been replaced in the DOM tree, setting this parameter has no effect.
javax.xml.stream.isSupportingExternalEntities Yes
javax.xml.stream.supportDTD

True is always supported. Setting the value to false works only if the com.ibm.xml.xlxp.support.dtd.compat.mode system property is also set to false.

When both properties are set to false, parsers created by the factory throw an XMLStreamException when they encounter an entity reference that requires expansion. This setting is useful for protecting against Denial of Service (DoS) attacks involving entities declared in the DTD.

Setting the value to false does not work before Service Refresh 2.

javax.xml.stream.reporter Yes
javax.xml.stream.resolver Yes

XL XP-J also supports the optional method createXMLStreamReader(javax.xml.transform.Source), which allows StAX readers to be created from DOM and SAX sources.

XL XP-J also supports the javax.xml.stream.isSupportingLocationCoordinates property. If you set this property to true, XMLStreamReaders created by the factory return accurate line, column, and character information using Location objects. If you set this property to false, line, column, and character information is not available. By default, this property is set to false for performance reasons.

XMLStreamReader reference

The javax.xml.stream.XMLStreamReader implementation supports the following properties, as described in the XMLStreamReader Javadoc: http://java.sun.com/javase/6/docs/api/javax/xml/stream/XMLStreamReader.html.

Property name Supported?
javax.xml.stream.entities Yes
javax.xml.stream.notations Yes

XL XP-J also supports the javax.xml.stream.isInterning property. This property returns a boolean value indicating whether or not XML names and namespace URIs returned by the API calls have been interned by the parser. This property is read-only.

XMLOutputFactory reference

The javax.xml.stream.XMLOutputFactory implementation supports the following properties, as described in the XMLOutputFactory Javadoc: http://java.sun.com/javase/6/docs/api/javax/xml/stream/XMLOutputFactory.html.

Property name Supported?
javax.xml.stream.isRepairingNamespaces Yes

XL XP-J also supports the javax.xml.stream.XMLOutputFactory.recycleWritersOnEndDocument property. If you set this property to true, XMLStreamWriters created by this factory are recycled when writeEndDocument() is called. After recycling, some XMLStreamWriter methods, such as getNamespaceContext(), must not be called. By default, XMLStreamWriters are recycled when close() is called. You must call the XMLStreamWriter.close() method when you have finished with an XMLStreamWriter, even if this property is set to true.

XMLStreamWriter reference

The javax.xml.stream.XMLStreamWriter implementation supports the following properties, as described in the XMLStreamWriter Javadoc: http://java.sun.com/javase/6/docs/api/javax/xml/stream/XMLStreamWriter.html.

Property name Supported?
javax.xml.stream.isRepairingNamespaces Yes

Properties on XMLStreamWriter objects are read-only.

XL XP-J also supports the javax.xml.stream.XMLStreamWriter.isSetPrefixBeforeStartElement property. This property returns a Boolean indicating whether calls to setPrefix() and setDefaultNamespace() should occur before calls to writeStartElement() or writeEmptyElement() to put a namespace prefix in scope for that element. XL XP-J always returns false; calls to setPrefix() and setDefaultNamespace() should occur after writeStartElement() or writeEmptyElement().

XL TXE-J reference information

XL TXE-J is an XSLT library containing the XSLT4J 2.7.8 interpreter and a XSLT compiler.

Feature comparison table

Table 2. Comparison of the features in the XSLT4J interpreter, the XSLT4J compiler, and the XL TXE-J compiler.
Feature XSLT4J interpreter (included) XSLT4J compiler (not included) XL TXE-J compiler (included)
http://javax.xml.transform.stream.StreamSource/feature feature Yes Yes Yes
http://javax.xml.transform.stream.StreamResult/feature feature Yes Yes Yes
http://javax.xml.transform.dom.DOMSource/feature feature Yes Yes Yes
http://javax.xml.transform.dom.DOMResult/feature feature Yes Yes Yes
http://javax.xml.transform.sax.SAXSource/feature feature Yes Yes Yes
http://javax.xml.transform.sax.SAXResult/feature feature Yes Yes Yes
http://javax.xml.transform.stax.StAXSource/feature feature Yes No Yes
http://javax.xml.transform.stax.StAXResult/feature feature Yes No Yes
http://javax.xml.transform.sax.SAXTransformerFactory/feature feature Yes Yes Yes
http://javax.xml.transform.sax.SAXTransformerFactory/feature/xmlfilter feature Yes Yes Yes
http://javax.xml.XMLConstants/feature/secure-processing feature Yes Yes Yes
http://xml.apache.org/xalan/features/incremental attribute Yes No No
http://xml.apache.org/xalan/features/optimize attribute Yes No No
http://xml.apache.org/xalan/properties/source-location attribute Yes No No
translet-name attribute N/A Yes Yes (with new name)
destination-directory attribute N/A Yes Yes (with new name)
package-name attribute N/A Yes Yes (with new name)
jar-name attribute N/A Yes Yes (with new name)
generate-translet attribute N/A Yes Yes (with new name)
auto-translet attribute N/A Yes Yes (with new name)
use-classpath attribute N/A Yes Yes (with new name)
enable-inlining attribute No Yes No (obsolete in TL TXE-J)
indent-number attribute No Yes Yes (with new name)
debug attribute No Yes Yes (with new name)
Java extensions Yes Yes (abbreviated syntax only, xalan:component/xalan:script constructs not supported)
JavaScript extensions Yes No No
Extension elements Yes No No
EXSLT extension functions Yes Yes (excluding dynamic) Yes (excluding dynamic)
redirect extension Yes Yes (excluding redirect:open and redirect:close) Yes
output extension No Yes Yes
nodeset extension Yes Yes Yes
NodeInfo extension functions Yes No No
SQL library extension Yes No No
pipeDocument extension Yes No No
evaluate extension Yes No No
tokenize extension Yes No No
XML 1.1 Yes Yes Yes

Notes

  1. With the Process command, use -FLAVOR sr2sw to transform using StAX stream processing, and -FLAVOR er2ew for StAX event processing.
  2. The new compiler does not look for the org.apache.xalan.xsltc.dom.XSLTCDTMManager service provider. Instead, if StreamSource is used, the compiler switches to a high-performance XML parser.
  3. Inlining is obsolete in XL TXE-J.
  4. The org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl class is no longer supported.

Using an older version of Xerces or Xalan

If you are using an older version of Xerces (before 2.0) or Xalan (before 2.3) in the endorsed override, you might get a NullPointerException when you start your application. This exception occurs because these older versions do not handle the jaxp.properties file correctly.

About this task

To avoid this situation, use one of the following workarounds:

Debugging Java applications

To debug Java programs, you can use the Java Debugger (JDB) application or other debuggers that communicate by using the Java Platform Debugger Architecture (JPDA) that is provided by the SDK for the operating system.

More information about problem diagnosis using Java can be found in the Diagnostics Guide.

Java Debugger (JDB)

The Java Debugger (JDB) is included in the SDK for Windows. The debugger is started with the jdb command; it attaches to the JVM using JPDA.

To debug a Java application:

  1. Start the JVM with the following options:
    java -Xdebug -Xrunjdwp:transport=dt_shmem,server=y,address=<port> <class>
    The JVM starts up, but suspends execution before it starts the Java application.
  2. In a separate session, you can attach the debugger to the JVM:
    jdb -attach <port>
    The debugger will attach to the JVM, and you can now issue a range of commands to examine and control the Java application; for example, type run to allow the Java application to start.

For more information about JDB options, type:

jdb -help

For more information about JDB commands:

  1. Type jdb
  2. At the jdb prompt, type help

You can also use JDB to debug Java applications running on remote workstations. JPDA uses a TCP/IP socket to connect to the remote JVM.

  1. Start the JVM with the following options:
    java -Xdebug -Xrunjdwp:transport=dt_shmem,server=y,address=<port> <class>
    The JVM starts up, but suspends execution before it starts the Java application.
  2. Attach the debugger to the remote JVM:
    jdb -connect com.sun.jdi.SocketAttach:hostname=<host>,port=<port>

The Java Virtual Machine Debugging Interface (JVMDI) is not supported in this release. It has been replaced by the Java Virtual Machine Tool Interface (JVMTI).

For more information about JDB and JPDA and their usage, see these Web sites:

Selective debugging

Use the com.ibm.jvm.Debuggable annotation to mark classes and methods that should be available for debugging. Use the -XselectiveDebug parameter to enable selective debugging at run time. The JVM optimizes methods that do not need debugging to provide better performance in a debugging environment.

About this task

Selective debugging is useful when Java is being used as a framework for development, for example, as an IDE. The Java code for the IDE is optimized for performance while the user code is debugged.

Procedure

  1. Import the Debuggable annotation from the com.ibm.jvm package.
    import com.ibm.jvm.Debuggable;
  2. Decorate methods using the Debuggable annotation.
    @Debuggable
    public int method1() {
      ...
    }
  3. Optional: You can also decorate classes using the Debuggable annotation. All methods in the class will remain debuggable.
    @Debuggable
    public class Class1 {
      ...
    }
  4. Enable selective debugging at run time using the -XselectiveDebug command-line option.

Results

Applications will run faster while being debugged because the core Java API and any IDE code can be optimized for performance.

Determining whether your application is running on a 32-bit or 64-bit JVM

Some Java applications must be able to determine whether they are running on a 32-bit JVM or on a 64-bit JVM. For example, if your application has a native code library, the library must be compiled separately in 32- and 64-bit forms for platforms that support both 32- and 64-bit modes of operation. In this case, your application must load the correct library at runtime, because it is not possible to mix 32- and 64-bit code.

About this task

The system property com.ibm.vm.bitmode allows applications to determine the mode in which your JVM is running. It returns the following values:

You can inspect the com.ibm.vm.bitmode property from inside your application code using the call:

System.getProperty("com.ibm.vm.bitmode");

How the JVM processes signals

When a signal is raised that is of interest to the JVM, a signal handler is called. This signal handler determines whether it has been called for a Java or non-Java thread.

If the signal is for a Java thread, the JVM takes control of the signal handling. If an application handler for this signal is installed and you did not specify the -Xnosigchain command-line option, the application handler for this signal is called after the JVM has finished processing.

If the signal is for a non-Java thread, and the application that installed the JVM had previously installed its own handler for the signal, control is given to that handler. Otherwise, if the signal is requested by the JVM or Java application, the signal is ignored or the default action is taken.

Where a signal is generated externally (for example, when you enter CTRL-BREAK), a new thread is created for the signal handler. In this case, the JVM signal handler performs its processing and if an application handler for this signal is installed and you did not specify the -Xnosigchain command-line option, the application handler for this signal is called.

For exception and error signals, the JVM either:

For information about writing a launcher that specifies the above hooks, see: http://www.ibm.com/developerworks/java/library/i-signalhandling/. This item was written for Java V1.3.1, but still applies to later versions.

For interrupt signals, the JVM also enters a controlled shut down sequence, but this time it is treated as a normal termination that:

  1. Calls your application's signal handler for that signal
  2. Calls all application shut down hooks
  3. Calls any application-installed exit hook
  4. Performs the necessary JVM cleanup

The shut down is identical to the shut down initiated by a call to the Java method System.exit().

Other signals that are used by the JVM are for internal control purposes and do not cause it to stop. The only control signal of interest is SIGBREAK, which causes a Javadump to be generated.

Signals used by the JVM

The types of signals are Interrupts, and Controls.

Table 3 shows the signals that are used by the JVM. The signals are grouped in the table by type or use, as follows:

Exceptions
The operating system synchronously raises an appropriate exception signal whenever an unrecoverable condition occurs.
Errors
The JVM raises a SIGABRT if it detects a condition from which it cannot recover.
Interrupts
Interrupt signals are raised asynchronously, from outside a JVM process, to request shut down.
Controls
Other signals that are used by the JVM for control purposes.

Table 3. Signals used by the JVM
Signal Name Signal type Description Disabled by -Xrs
SIGINT (2) Interrupt Interactive attention (CTRL-C). JVM exits normally. Yes
SIGTERM (15) Interrupt Termination request. JVM will exit normally. Yes
SIGBREAK Control A break signal from a terminal. By default, this triggers a Javadump. Yes
Note: A number supplied after the signal name is the standard numeric value for that signal.

The IBM JVM uses structured exception handling and the SetConsoleCtrlHandler() API. These are disabled with -Xrs. -Xnosigchain is ignored on Windows.

Use the -Xrs (reduce signal usage) option to prevent the JVM from handling most signals. For more information, see Sun's Java application launcher page.

The signals 2 (SIGINT) and 15 (SIGTERM) on JVM threads causes the JVM to shut down; therefore, an application signal handler should not attempt to recover from this signal unless it no longer requires the JVM.

Linking a native code driver to the signal-chaining library

The Runtime Environment contains signal-chaining. Signal-chaining enables the JVM to interoperate more efficiently with native code that installs its own signal handlers.

About this task

Signal-chaining enables an application to link and load the shared library jsig.dll before msvcrt.dll. The jsig.dll library ensures that calls to signal() are intercepted so that their handlers do not replace the JVM's signal handlers. Instead, these calls save the new signal handlers, or "chain" them behind the handlers that are installed by the JVM. Later, when any of these signals are raised and found not to be targeted at the JVM, the preinstalled handlers are called.

The libjsig.dll library also hides JVM signal handlers from the application. Therefore, calls such as signal(), sigset(), and sigaction() that are made after the JVM has started no longer return a reference to the JVM's signal handler, but instead return any handler that was installed before JVM startup.

The environment variable JAVA_HOME should be set to the location of the SDK, for example,C:\Program Files\IBM\Java60\.

To use jsig.dll, link it with the application that creates or embeds a JVM.

Writing JNI applications

Valid Java Native Interface (JNI) version numbers that programs can specify on the JNI_CreateJavaVM() API call are: JNI_VERSION_1_2(0x00010002) and JNI_VERSION_1_4(0x00010004).

Restriction: Version 1.1 of the JNI is not supported.

This version number determines only the level of the JNI to use. The actual level of the JVM that is created is specified by the JSE libraries (that is, v6). The JNI level does not affect the language specification that is implemented by the JVM, the class library APIs, or any other area of JVM behavior. For more information, see http://java.sun.com/javase/6/docs/technotes/guides/jni/.

If your application needs two JNI libraries, one built for 32- and the other for 64-bit, use the com.ibm.vm.bitmode system property to determine if you are running with a 32- or 64-bit JVM and choose the appropriate library.

Supported compilers

The Microsoft Visual Studio v8 compiler is supported for Windows 32-bit on Intel®.

Configuring large page memory allocation

You can enable large page support, on systems that support it, by starting Java with the -Xlp option.

About this task

Large page usage is primarily intended to provide performance improvements to applications that allocate a great deal of memory and frequently access that memory. The large page performance improvements are a result of the reduced number of misses in the Translation Lookaside Buffer (TLB). The TLB maps a larger virtual storage area range and thus causes this improvement.

For the JVM to use large pages, your system must have an adequate number of contiguous large pages available. If large pages cannot be allocated, even when enough pages are available, possibly the large pages are not contiguous.

Large page allocations only succeed if the local administrative policy for the JVM user is configured to enable "Lock pages in memory".

Note: On Microsoft Windows Vista and Windows 2008, use of large pages is affected by the User Account Control (UAC) feature. When UAC is enabled, a regular user (a member of the Users group) can use the -Xlp option as normal. However, an administrative user (a member of the Administrators group) must run the application as an administrator to gain the privileges required to lock pages in memory. To run as administrator, right-click the application and select Run as administrator. If the user does not have the necessary privileges, an error message is produced, advising that the System configuration does not support option '-Xlp'.

CORBA support

The Java Platform, Standard Edition (JSE) supports, at a minimum, the specifications that are defined in the compliance document from Sun. In some cases, the IBM JSE ORB supports more recent versions of the specifications.

The minimum specifications supported are defined in the Official Specifications for CORBA support in Java SE 6: http://java.sun.com/javase/6/docs/api/org/omg/CORBA/doc-files/compliance.html.

Support for GIOP 1.2

This SDK supports all versions of GIOP, as defined by chapters 13 and 15 of the CORBA 2.3.1 specification, OMG document formal/99-10-07.

http://www.omg.org/cgi-bin/doc?formal/99-10-07

Bidirectional GIOP is not supported.

Support for Portable Interceptors

This SDK supports Portable Interceptors, as defined by the OMG in the document ptc/01-03-04, which you can obtain from:

http://www.omg.org/cgi-bin/doc?ptc/01-03-04

Portable Interceptors are hooks into the ORB that ORB services can use to intercept the normal flow of execution of the ORB.

Support for Interoperable Naming Service

This SDK supports the Interoperable Naming Service, as defined by the OMG in the document ptc/00-08-07, which you can obtain from:

http://www.omg.org/cgi-bin/doc?ptc/00-08-07

The default port that is used by the Transient Name Server (the tnameserv command), when no ORBInitialPort parameter is given, has changed from 900 to 2809, which is the port number that is registered with the IANA (Internet Assigned Number Authority) for a CORBA Naming Service. Programs that depend on this default might have to be updated to work with this version.

The initial context that is returned from the Transient Name Server is now an org.omg.CosNaming.NamingContextExt. Existing programs that narrow the reference to a context org.omg.CosNaming.NamingContext still work, and do not need to be recompiled.

The ORB supports the -ORBInitRef and -ORBDefaultInitRef parameters that are defined by the Interoperable Naming Service specification, and the ORB::string_to_object operation now supports the ObjectURL string formats (corbaloc: and corbaname:) that are defined by the Interoperable Naming Service specification.

The OMG specifies a method ORB::register_initial_reference to register a service with the Interoperable Naming Service. However, this method is not available in the Sun Java Core API at Version 6. Programs that have to register a service in the current version must invoke this method on the IBM internal ORB implementation class. For example, to register a service "MyService":

((com.ibm.CORBA.iiop.ORB)orb).register_initial_reference("MyService",
serviceRef);

Where orb is an instance of org.omg.CORBA.ORB, which is returned from ORB.init(), and serviceRef is a CORBA Object, which is connected to the ORB. This mechanism is an interim one, and is not compatible with future versions or portable to non-IBM ORBs.

System properties for tracing the ORB

A runtime debug feature provides improved serviceability. You might find it useful for problem diagnosis or it might be requested by IBM service personnel.

Tracing Properties

com.ibm.CORBA.Debug=true
Turns on ORB tracing.
com.ibm.CORBA.CommTrace=true
Adds GIOP messages (sent and received) to the trace.
com.ibm.CORBA.Debug.Output=<file>
Specify the trace output file. By default, this is of the form orbtrc.DDMMYYYY.HHmm.SS.txt.

Example of ORB tracing

For example, to trace events and formatted GIOP messages from the command line, type:

java -Dcom.ibm.CORBA.Debug=true
     -Dcom.ibm.CORBA.CommTrace=true <myapp>

Limitations

Do not enable tracing for normal operation, because it might cause performance degradation. Even if you have switched off tracing, FFDC (First Failure Data Capture) is still working, so serious errors are reported. If a debug output file is generated, examine it to check on the problem. For example, the server might have stopped without performing an ORB.shutdown().

The content and format of the trace output might vary from version to version.

System properties for tuning the ORB

The ORB can be tuned to work well with your specific network. The properties required to tune the ORB are described here.

com.ibm.CORBA.FragmentSize=<size in bytes>
Used to control GIOP 1.2 fragmentation. The default size is 1024 bytes.

To disable fragmentation, set the fragment size to 0 bytes:

java -Dcom.ibm.CORBA.FragmentSize=0 <myapp>
com.ibm.CORBA.RequestTimeout=<time in seconds>
Sets the maximum time to wait for a CORBA Request. By default the ORB waits indefinitely. Do not set the timeout too low to avoid connections ending unnecessarily.
com.ibm.CORBA.LocateRequestTimeout=<time in seconds>
Set the maximum time to wait for a CORBA LocateRequest. By default the ORB waits indefinitely.
com.ibm.CORBA.ListenerPort=<port number>
Set the port for the ORB to read incoming requests on. If this property is set, the ORB starts listening as soon as it is initialized. Otherwise, it starts listening only when required.

Java security permissions for the ORB

When running with a Java SecurityManager, invocation of some methods in the CORBA API classes might cause permission checks to be made, which might result in a SecurityException. If your program uses any of these methods, ensure that it is granted the necessary permissions.

Table 4. Methods affected when running with Java SecurityManager
Class/Interface Method Required permission
org.omg.CORBA.ORB init java.net.SocketPermission resolve
org.omg.CORBA.ORB connect java.net.SocketPermission listen
org.omg.CORBA.ORB resolve_initial_references java.net.SocketPermission connect
org.omg.CORBA. portable.ObjectImpl _is_a java.net.SocketPermission connect
org.omg.CORBA. portable.ObjectImpl _non_existent java.net.SocketPermission connect
org.omg.CORBA. portable.ObjectImpl OutputStream _request (String, boolean) java.net.SocketPermission connect
org.omg.CORBA. portable.ObjectImpl _get_interface_def java.net.SocketPermission connect
org.omg.CORBA. Request invoke java.net.SocketPermission connect
org.omg.CORBA. Request send_deferred java.net.SocketPermission connect
org.omg.CORBA. Request send_oneway java.net.SocketPermission connect
javax.rmi. PortableRemoteObject narrow java.net.SocketPermission connect

ORB implementation classes

A list of the ORB implementation classes.

The ORB implementation classes in this release are:

These are the default values, and you are advised not to set these properties or refer to the implementation classes directly. For portability, make references only to the CORBA API classes, and not to the implementation. These values might be changed in future releases.

RMI over IIOP

Java Remote Method Invocation (RMI) provides a simple mechanism for distributed Java programming. RMI over IIOP (RMI-IIOP) uses the Common Object Request Broker Architecture (CORBA) standard Internet Inter-ORB Protocol (IIOP) to extend the base Java RMI to perform communication. This allows direct interaction with any other CORBA Object Request Brokers (ORBs), whether they were implemented in Java or another programming language.

The following documentation is available:

Implementing the Connection Handler Pool for RMI

Thread pooling for RMI Connection Handlers is not enabled by default.

About this task

To enable the connection pooling implemented at the RMI TCPTransport level, set the option

-Dsun.rmi.transport.tcp.connectionPool=true

This version of the Runtime Environment does not have a setting that you can use to limit the number of threads in the connection pool.

Enhanced BigDecimal

From Java 5.0, the IBM BigDecimal class has been adopted by Sun as java.math.BigDecimal. The com.ibm.math.BigDecimal class is reserved for possible future use by IBM and is currently deprecated. Migrate existing Java code to use java.math.BigDecimal.

The new java.math.BigDecimal uses the same methods as both the previous java.math.BigDecimal and com.ibm.math.BigDecimal. Existing code using java.math.BigDecimal continues to work correctly. The two classes do not serialize.

To migrate existing Java code to use the java.math.BigDecimal class, change the import statement at the top of your .java file from: import com.ibm.math.*; to import java.math.*;.

Support for the Java Attach API

The Java Attach API allows your application to connect to another virtual machine (the "target"). Your application can then load an agent application into the target virtual machine, for example to perform tasks such as monitoring status.

Code for agent applications, such as JMX agents or JVMTI agents, is normally loaded during virtual machine startup by specifying special startup parameters. Requiring startup parameters might not be convenient for using agents on applications that are already running, such as WebSphere Application Servers. Using the Java Attach API, lets you load an agent at any time by specifying the process ID of the target virtual machine. The Attach API capability is sometimes called the "late attach" capability.

The Attach API is enabled by default for Java 6 SR 6 and later.

Security considerations

The Java Attach API creates files and directories in a common directory. On Windows, security of the common directory and its subdirectories and files is handled by Windows security mechanisms. This means that only the process owner can connect to their processes.

You must secure access to the Java Attach API capability to ensure that only authorized users or processes can connect to another virtual machine. If you do not intend to use the Java Attach API capability, disable this feature using the Java system property. Set the com.ibm.tools.attach.enable system property to the value no; for example:

-Dcom.ibm.tools.attach.enable=no

Using the Java Attach API

By default, the target virtual machine is identified by its process ID. To use a different target, change the system property com.ibm.tools.attach.id; for example:

-Dcom.ibm.tools.attach.id=<process_ID>

The target process also has a human-readable "display name". By default, the display name is the command line used to launch Java. To change the default display name, use the com.ibm.tools.attach.displayName system property. The ID and display name cannot be changed after the application has started.

The Attach API creates working files in a common directory called .com_ibm_tools_attach, which is created in the system temporary directory. The system property java.io.tmpdir holds the value of the system temporary directory. On Windows systems, the system temporary directory is typically C:\Documents and Settings\<userid>\Local Settings\Temp. To modify the working directory, use the Java system property com.ibm.tools.attach.directory; for example:

-Dcom.ibm.tools.attach.directory=C:\working

If your Java application ends abnormally, for example, following a crash or a SIGKILL signal, the process subdirectory is not deleted. The Java VM detects and removes obsolete subdirectories where possible. The subdirectory can also be deleted by the owning userid.

On heavily loaded system, applications might experience timeouts when attempting to connect to target applications. The default timeout is 120 seconds. Use the com.ibm.tools.attach.timeout system property to specify a different timeout value in seconds. For example, to timeout after 60 seconds:

-Dcom.ibm.tools.attach.timeout=60

A timeout value of zero indicates an indefinite wait.

For JMX applications, you might need to disable authentication by editing the <JAVA_HOME>/jre/lib/management/management.properties file. Set the following properties to disable authentication in JMX:

com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false

An unsuccessful attempt to invoke the Attach API results in one of the following exceptions:

A useful reference for information about the Attach API can be found at http://java.sun.com/javase/6/docs/technotes/guides/attach/index.html. The IBM implementation of the Attach API corresponds approximately to the Sun Microsystems, Inc. implementation. However, if your application originally used com.sun.tools.attach.* methods or classes, you must modify and recompile the application to use the com.ibm.tools.attach.* implementation.

Plug-in, Applet Viewer and Web Start

The Java plug-in is used to run Java applications in the browser. The appletviewer is used to test applications designed to be run in a browser. Java Web Start is used to deploy desktop Java applications over a network, and provides a mechanism for keeping them up-to-date.

Using the Java plug-in

The Java plug-in is a Web browser plug-in. You use the Java plug-in to run applets in the browser.

You must allow applets to finish loading to prevent your browser from stopping. For example, if you use the Back button and then the Forward button while an applet is loading, the HTML pages might be unable to load.

The Java plug-in is documented by Sun at: http://java.sun.com/javase/6/docs/technotes/guides/plugin/developer_guide/.

Supported browsers

The Java plug-in supports Internet Explorer, and Mozilla Firefox.

Table 5. Browsers supported by the Java plug-in on Windows
Browser Supported versions
Internet Explorer 6.0 SP1, 7.0, 8.0
Firefox 2.0, 3.0, 3.5

Later minor releases of these browsers are also supported.

Internet Explorer 5.01, the default browser on Windows 2000, is not supported.

Installing the Java plug-in using the Java control panel

You can use the Java control panel to install the Java plug-in for Internet Explorer and Mozilla Firefox.

Before you begin

The IBM SDK for Java must be installed before using this method.

About this task

If you did not install the Java plug-in when you installed the SDK, follow these steps to install the plug-in using the Java control panel:

Procedure

  1. Open the Windows Control Panel.
  2. Double-click IBM Control Panel for Java.
  3. Select the Advanced tab.
  4. Select Default Java for Browsers.
  5. To install the Java plug-in for specific browsers, select the corresponding check box. To remove the Java plug-in from specific browsers, clear the corresponding check box. On Windows Vista, Windows Server 2008 R2 and Windows 7, the check box to associate with Internet Explorer is disabled by default. You cannot change this selection. By default, the Next-Generation plug-in is enabled. If you want to switch between a Next-Generation and old style plug-in, follow these steps:
    1. Open the IBM Control Panel for Java.
    2. Select Advanced -> Java Plug-in and check or clear the option Enable the next-generation Java Plug-in. This action changes the association between old style and Next-Generation plug-ins.

What to do next

Restriction: On Windows Vista with Federal Desktop Core Configuration (FDCC), you must run the Java Control Panel in elevated privilege mode. Browse to the <SDK>\jre\bin directory in Explorer, right-click the javacpl.exe icon, and select Run as administrator.

Secure Static Versioning (SSV) support

Static versioning allows applets to request a specific JVM version to be run under. Secure Static Versioning is used on Internet Explorer because this capability allows applets to use old security vulnerabilities on systems that have been upgraded to a new JVM.

About this task

Secure Static Versioning (SSV) support is not applicable for Next Generation plug-ins.

SSV does not function if third-party browser extensions are disabled in Internet Explorer. To enable third-party browser extensions:

  1. Open Internet Explorer.
  2. Click Tools -> Internet Options.
  3. Click the Advanced tab.
  4. Select the Enable third-party browser extensions check box.

If third-party browser extensions are disabled after SSV has been used, SSV will continue to function.

Common Document Object Model (DOM) support

Because of limitations in particular browsers, you might not be able to implement all the functions of the org.w3c.dom.html package.

One of the following errors is thrown:

Using DBCS parameters

The Java plug-in supports double-byte characters (for example, Chinese Traditional BIG-5, Korean, and Japanese) as parameters for the tags <APPLET>, <OBJECT>, and <EMBED>. You must select the correct character encoding for your HTML document so that the Java plug-in can parse the parameter.

About this task

Specify character encoding for your HTML document by using the <META> tag in the <HEAD> section like this:

<meta http-equiv="Content-Type" content="text/html; charset=big5">

This example tells the browser to use the Chinese BIG-5 character encoding to parse the HTML file.

Working with applets

With the Applet Viewer, you can run one or more applets that are called by reference in a Web page (HTML file) by using the <APPLET> tag. The Applet Viewer finds the <APPLET> tags in the HTML file and runs the applets, in separate windows, as specified by the tags.

Because the Applet Viewer is for viewing applets, it cannot display a whole Web page that contains many HTML tags. It parses only the <APPLET> tags and no other HTML on the Web page.

Running and debugging applets with the Applet Viewer

Use the following commands to run and debug an applet with the Applet Viewer.

About this task

Running applets with the Applet Viewer:

From a command prompt, enter:

   appletviewer <name>

where <name> is one of the following:

For example, to start the Applet Viewer on an HTML file that calls an applet, type at a command prompt:

appletviewer <demo>\GraphLayout\example1.html

Where <demo> is replaced by the full path into which you unzipped the demo package.

To start the Applet Viewer on a Web page, type at a command prompt:

appletviewer http://java.sun.com/applets/jdk/1.4/demo/applets/NervousText/example1.html

The Applet Viewer does not recognize the charset option of the <

META

> tag. If the file that the Applet Viewer loads is not encoded as the system default, an I/O exception might occur. To avoid the exception, use the -encoding option when you run appletviewer. For example:

appletviewer -encoding JISAutoDetect sample.html

Debugging applets with the Applet Viewer:

For example:

cd demo\applets\TicTacToe
..\..\..\bin\appletviewer -debug example1.html

You can find documentation about how to debug applets using the Applet Viewer at the Sun Web site: http://java.sun.com/javase/6/docs/technotes/guides/plugin/developer_guide/debugger.html.

Unique CLSIDs

A unique set of CLSIDs have been added to the IBM JVM from Version 6.

The following are the new CLSIDs:

1ACECAFE-0016-0000-0000-ABCDEFFEDCBA
1ACECAFE-0016-0000-0000-ABCDEFFEDCBB
1ACECAFE-0016-0000-0000-ABCDEFFEDCBC

You can refer to the above CLSIDs in the OBJECT Tag for your applets.

In addition, the following existing CLSIDs are also supported for compatibility purposes:

CAFEEFAC-0016-0000-0000-ABCDEFFEDCBA
CAFEEFAC-0016-0000-0000-ABCDEFFEDCBB
CAFEEFAC-0016-0000-0000-ABCDEFFEDCBC

Using Web Start

Java Web Start is used for Java application deployment.

With Web Start, you can start and manage applications directly from the Web. Applications are cached to minimize installation times. Applications are automatically upgraded when new versions become available.

Web Start supports these command-line arguments documented at http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html#resources:

Web Start also supports -Xgcpolicy to set the garbage collection policy.

For more information about Web Start, see:

For more information about deploying applications, see:

Running Web Start

Web Start can be run from a Web page or the command line. Web Start applications are stored in the Java Application Cache.

About this task

You can start Web Start in a number of different ways.

Procedure

WebStart Secure Static Versioning

Static versioning allows Web Start applications to request a specific JVM version on which those applications will run. Because static versioning also allows applications to exploit old security vulnerabilities on systems that have been upgraded to a new JVM, Secure Static Versioning (SSV) is now used by default.

With SSV, the user is warned before running any unsigned Web Start application that requests a specific JVM, if the requested JVM is installed. Signed applications and applications that request the latest version of the JVM run as usual.

You can disable SSV by setting the deployment.javaws.ssv.enabled property in the deployment.properties file to false.

SSV is not supported for Next-Generation plug-ins. SSV is applicable only for old style plug-ins.

Distributing Java applications

Java applications typically consist of class, resource, and data files.

When you distribute a Java application, your software package probably consists of the following parts:

To run your application, a user needs the Runtime Environment for Windows. The SDK for Windows software contains a Runtime Environment. However, you cannot assume that your users have the SDK for Windows software installed.

Your SDK for Windows software license does not allow you to redistribute any of the SDK's files with your application. You must ensure that a licensed version of the SDK for Windows is installed on the target workstation.

Class data sharing between JVMs

Class data sharing allows multiple JVMs to share a single space in memory.

The Java Virtual Machine (JVM) allows you to share class data between JVMs by storing it in a memory-mapped cache file on disk. Sharing reduces the overall virtual storage consumption when more than one JVM shares a cache. Sharing also reduces the startup time for a JVM after the cache has been created. The shared class cache is independent of any running JVM and persists until it is destroyed.

A shared cache can contain:

Overview of class data sharing

Class data sharing provides a transparent method of reducing memory footprint and improving JVM start-up time. Java 6 provides new and improved features in cache management, isolation, and performance.

Enabling class data sharing

Enable class data sharing by using the -Xshareclasses option when starting a JVM. The JVM connects to an existing cache or creates a new cache if one does not exist.

All bootstrap and application classes loaded by the JVM are shared by default. Custom classloaders share classes automatically if they extend the application classloader; otherwise, they must use the Java Helper API provided with the JVM to access the cache. See Adapting custom classloaders to share classes.

The JVM can also store ahead-of-time (AOT) compiled code in the cache for certain methods to improve the startup time of subsequent JVMs. The AOT compiled code is not shared between JVMs, but is cached to reduce compilation time when the JVM starts up. The amount of AOT code stored in the cache is determined heuristically. You cannot control which methods get stored in the cache, but you can set upper and lower limits on the amount of cache space used for AOT code, or you can choose to disable AOT caching completely. See Class data sharing command-line options for more information.

Cache access

A JVM can access a cache with either read-write or read-only access. Any JVM connected to a cache with read-write access can update the cache. Any number of JVMs can concurrently read from the cache, even while another JVM is writing to it.

You must take care if runtime bytecode modification is being used. See Runtime bytecode modification for more information.

Dynamic updating of the cache

Because the shared class cache persists beyond the lifetime of any JVM, the cache is updated dynamically to reflect any modifications that might have been made to JARs or classes on the file system. The dynamic updating makes the cache transparent to the application using it.

Cache security

Access to the shared class cache is limited by operating system permissions and Java security permissions. Only a classloader that has registered to share class data can update the shared class cache.

The cache memory is protected against accidental or deliberate corruption using memory page protection. This protection is not an absolute guarantee against corruption because the JVM must unprotect pages to write to them. The only way to guarantee that a cache cannot be modified is to open it read-only.

If a Java SecurityManager is installed, classloaders, excluding the default bootstrap, application, and extension classloaders, must be granted permission to share classes by adding SharedClassPermission lines to the java.policy file. See Using SharedClassPermission. The RuntimePermission createClassLoader restricts the creation of new classloaders and therefore also restricts access to the cache.

Cache lifespan

Multiple caches can exist on a system and you specify them by name as a suboption to the -Xshareclasses command. A JVM can connect to only one cache at any one time.

You can override the default cache size on startup using -Xscmx<n><size>. This size is then fixed for the lifetime of the cache. Caches exist until they are explicitly destroyed using a suboption to the -Xshareclasses command or the cache file is deleted manually.

Cache utilities

All cache utilities are suboptions to the -Xshareclasses command. See Class data sharing command-line options or use -Xshareclasses:help to see a list of available suboptions.

Class data sharing command-line options

Class data sharing and the cache management utilities are controlled using command-line options to the Java launcher.

For options that take a <size> parameter, suffix the number with "k" or "K" to indicate kilobytes, "m" or "M" to indicate megabytes, or "g" or "G" to indicate gigabytes.

-Xscmaxaot<size>
Sets the maximum number of bytes in the cache that can be used for AOT data. Use this option to ensure a certain amount of cache space is available for non-AOT data. By default, the maximum limit for AOT data is the amount of free space in the cache. The value of this option should not be smaller than the value of -Xscminaot and must not be larger than the value of -Xscmx.
-Xscminaot<size>
Sets the minimum number of bytes in the cache to reserve for AOT data. By default, no space is reserved for AOT data, although AOT data is written to the cache until the cache is full or the -Xscmaxaot limit is reached. The value of this option must not exceed the value of -Xscmx or -Xscmaxaot. The value of -Xscminaot must always be considerably less than the total cache size because AOT data can be created only for cached classes. If the value of -Xscminaot is equal to the value of -Xscmx, no class data or AOT data is stored because AOT data must be associated with a class in the cache.
-Xscmx<size>
Specifies cache size. This option applies only if a cache is being created and no cache of the same name exists. The default cache size is platform-dependent. You can find out the size value being used by adding -verbose:sizes as a command-line argument. The minimum cache size is 4 KB. The maximum cache size is also platform-dependent. (See Cache size limits.)
-Xshareclasses:<suboption>[,<suboption>...]
Enables class data sharing. Can take a number of suboptions, some of which are cache utilities. Cache utilities perform the required operation on the specified cache, without starting the VM. You can combine multiple suboptions, separated by commas, but the cache utilities are mutually exclusive. When running cache utilities, the message Could not create the Java virtual machine is expected. Cache utilities do not create the virtual machine.

Some cache utilities can work with caches from previous Java versions or caches created by JVMs with different bit-widths. These caches are referred to as "incompatible" caches.

You can use the following suboptions with the -Xshareclasses option:

help
Lists all the command-line suboptions.
name=<name>
Connects to a cache of a given name, creating the cache if it does not already exist. Also used to indicate the cache that is to be modified by cache utilities; for example, destroy. Use the listAllCaches utility to show which named caches are currently available. If you do not specify a name, the default name "sharedcc_%u" is used. %u in the cache name inserts the current user name.
cacheDir=<directory>
Sets the directory in which cache data is read and written. By default, <directory> is the user's C:\Documents and Settings\<username>\Local Settings\Application Data\javasharedresources directory. The user must have sufficient permissions in <directory>. The JVM writes persistent cache files directly into the directory specified. Persistent cache files can be safely moved and deleted from the file system. Non-persistent caches are stored in shared memory and have control files that describe the location of the memory. Control files are stored in a javasharedresources subdirectory of the cacheDir specified. Do not move or delete control files in this directory. The listAllCaches utility, the destroyAll utility, and the expire suboption work only in the scope of a given cacheDir.
readonly
Opens an existing cache with read-only permissions. The JVM does not create a new cache with this suboption. Opening a cache read-only prevents the JVM from making any updates to the cache. It also allows the JVM to connect to caches created by other users or groups without requiring write access. By default, this suboption is not specified.
persistent (default)
Uses a persistent cache. The cache is created on disk, which persists beyond operating system restarts. Non-persistent and persistent caches can have the same name.
nonpersistent
Uses a non-persistent cache. The cache is deleted when the operating system shuts down. Non-persistent and persistent caches can have the same name. You must always use the nonpersistent suboption when running utilities such as destroy on a non-persistent cache.
verbose
Enables verbose output, which provides overall status on the shared class cache and more detailed error messages.
verboseAOT
Enables verbose output when compiled AOT code is being found or stored in the cache. AOT code is generated heuristically. You might not see any AOT code generated at all for a small application. You can disable AOT caching using the noaot suboption.
verboseIO
Gives detailed output on the cache I/O activity, listing information on classes being stored and found. Each classloader is given a unique ID (the bootstrap loader is always 0) and the output shows the classloader hierarchy at work, where classloaders must ask their parents for a class before they can load it themselves. It is usual to see many failed requests; this behavior is expected for the classloader hierarchy.
verboseHelper
Enables verbose output for the Java Helper API. This output shows you how the Helper API is used by your ClassLoader.
silent
Turns off all shared classes messages, including error messages. Unrecoverable error messages, which prevent the JVM from initializing, are displayed.
nonfatal
Allows the JVM to start even if class data sharing fails. Normal behavior for the JVM is to refuse to start if class data sharing fails. If you select nonfatal and the shared classes cache fails to initialize, the JVM attempts to connect to the cache in read-only mode. If this attempt fails, the JVM starts without class data sharing.
none
Can be added to the end of a command line to disable class data sharing. This suboption overrides class sharing arguments found earlier on the command line.
modified=<modified context>
Used when a JVMTI agent is installed that might modify bytecode at runtime. If you do not specify this suboption and a bytecode modification agent is installed, classes are safely shared with an extra performance cost. The <modified context> is a descriptor chosen by the user; for example, "myModification1". This option partitions the cache, so that only JVMs using context myModification1 can share the same classes. For instance, if you run HelloWorld with a modification context and then run it again with a different modification context, all classes are stored twice in the cache. See Runtime bytecode modification for more information.
reset
Causes a cache to be destroyed and then recreated when the JVM starts up. Can be added to the end of a command line as -Xshareclasses:reset.
destroy (Utility option)
Destroys a cache specified by the name, cacheDir, and nonpersistent suboptions. A cache can be destroyed only if all JVMs using it have shut down, and the user has sufficient permissions.
destroyAll (Utility option)
Tries to destroy all caches available using the specified cacheDir and nonpersistent suboptions. A cache can be destroyed only if all JVMs using it have shut down, and the user has sufficient permissions.
expire=<time in minutes>
Destroys all caches that have been unused for the time specified before loading shared classes. This option is not a utility option because it does not cause the JVM to exit. On NTFS file systems, the expire option is accurate to the nearest hour.
listAllCaches (Utility option)
Lists all the compatible and incompatible caches that exist in the specified cache directory. If you do not specify cacheDir, the default directory is used. Summary information, such as Java version and current usage is displayed for each cache.
printStats (Utility option)
Displays summary information for the cache specified by the name, cacheDir, and nonpersistent suboptions. The most useful information displayed is how full the cache is and how many classes it contains. Stale classes are classes that have been updated on the file system and which the cache has therefore marked "stale". Stale classes are not purged from the cache and can be reused. See the Diagnostics Guide for more information.
printAllStats (Utility option)
Displays detailed information for the cache specified by the name, cacheDir, and nonpersistent suboptions. Every class is listed in chronological order, with a reference to the location from which it was loaded. AOT code for class methods is also listed.

See the Diagnostics Guide for more information.

mprotect=[ all | default | none ]
By default, the memory pages containing the cache are protected at all times, unless a specific page is being updated. This protection helps prevent accidental or deliberate corruption to the cache. The cache header is not protected by default because this protection has a small performance cost. Specifying all ensures that all the cache pages are protected, including the header. Specifying none disables the page protection.
noBootclasspath
Prevents storage of classes loaded by the bootstrap classloader in the shared classes cache. Can be used with the SharedClassURLFilter API to control exactly which classes get cached. See the Diagnostics Guide for more information about shared class filtering.
cacheRetransformed
Enables caching of classes that have been transformed using the JVMTI RetransformClasses function.
noaot
Disables caching of AOT code. AOT code already in the shared data cache can be loaded.

Creating, populating, monitoring, and deleting a cache

An overview of the life-cycle of a shared class data cache including examples of the cache management utilities.

To enable class data sharing, add -Xshareclasses[:name=<name>] to your application command line.

The JVM either connects to an existing cache of the given name or creates a new cache of that name. If a new cache is created, it is populated with all bootstrap and application classes being loaded until the cache becomes full. If two or more JVMs are started concurrently, they populate the cache concurrently.

To check that the cache has been created, run java -Xshareclasses:listAllCaches. To see how many classes and how much class data is being shared, run java -Xshareclasses:[name=<name>],printStats. You can run these utilities after the application JVM has terminated or in another command window.

For more feedback on cache usage while the JVM is running, use the verbose suboption. For example, java -Xshareclasses:[name=<name>],verbose.

To see classes being loaded from the cache or stored in the cache, add -Xshareclasses:[name=<name>],verboseIO to your application command line.

To delete the cache, run java -Xshareclasses:[name=<name>],destroy. You usually delete caches only if they contain many stale classes or if the cache is full and you want to create a bigger cache.

You should tune the cache size for your specific application, because the default is unlikely to be the optimum size. To determine the optimum cache size, specify a large cache, using -Xscmx, run the application, and then use printStats to determine how much class data has been stored. Add a small amount to the value shown in printStats for contingency. Because classes can be loaded at any time during the lifetime of the JVM, it is best to do this analysis after the application has terminated. However, a full cache does not have a negative affect on the performance or capability of any JVMs connected to it, so it is acceptable to decide on a cache size that is smaller than required.

If a cache becomes full, a message is displayed on the command line of any JVMs using the verbose suboption. All JVMs sharing the full cache then loads any further classes into their own process memory. Classes in a full cache can still be shared, but a full cache is read-only and cannot be updated with new classes.

Performance and memory consumption

Class data sharing is particularly useful on systems that use more than one JVM running similar code; the system benefits from reduced virtual storage consumption. It is also useful on systems that frequently start up and shut down JVMs, which benefit from the improvement in startup time.

The processor and memory usage required to create and populate a new cache is minimal. The JVM startup cost in time for a single JVM is typically between 0 and 5% slower compared with a system not using class data sharing, depending on how many classes are loaded. JVM startup time improvement with a populated cache is typically between 10% and 40% faster compared with a system not using class data sharing, depending on the operating system and the number of classes loaded. Multiple JVMs running concurrently show greater overall startup time benefits.

Duplicate classes are consolidated in the shared class cache. For example, class A loaded from myClasses.jar and class A loaded from myOtherClasses.jar (with identical content) is stored only once in the cache. The printAllStats utility shows multiple entries for duplicated classes, with each entry pointing to the same class.

When you run your application with class data sharing, you can use the operating system tools to see the reduction in virtual storage consumption.

Considerations and limitations of using class data sharing

Consider these factors when deploying class data sharing in a product and using class data sharing in a development environment.

Cache size limits

The maximum theoretical cache size is 2 GB. The size of the cache you can specify is limited by the amount of available disk space and available virtual address space.

The cache is limited by the following factors:

JVMTI RetransformClasses() is unsupported

You cannot run RetransformClasses() on classes loaded from the shared class cache.

The JVM might throw the exception UnmodifiableClassException if you attempt to run RetransformClasses(). It does not work because class file bytes are not available for classes loaded from the shared class cache. If you must use RetransformClasses(), ensure that the classes to be transformed are not loaded from the shared class cache, or disable the shared class cache feature.

Runtime bytecode modification

Any JVM using a JVM Tool Interface (JVMTI) agent that can modify bytecode data must use the modified=<modified_context> suboption if it wants to share the modified classes with another JVM.

The modified context is a user-specified descriptor that describes the type of modification being performed. The modified context partitions the cache so that all JVMs running under the same context share a partition.

This partitioning allows JVMs that are not using modified bytecode to safely share a cache with those that are using modified bytecode. All JVMs using a given modified context must modify bytecode in a predictable, repeatable manner for each class, so that the modified classes stored in the cache have the expected modifications when they are loaded by another JVM. Any modification must be predictable because classes loaded from the shared class cache cannot be modified again by the agent.

If a JVMTI agent is used without a modification context, classes are still safely shared by the JVM, but with a small affect on performance. Using a modification context with a JVMTI agent avoids the need for extra checks and therefore has no affect on performance. A custom ClassLoader that extends java.net.URLClassLoader and modifies bytecode at load time without using JVMTI automatically stores that modified bytecode in the cache, but the cache does not treat the bytecode as modified. Any other VM sharing that cache loads the modified classes. You can use the modified=<modification_context> suboption in the same way as with JVMTI agents to partition modified bytecode in the cache. If a custom ClassLoader needs to make unpredictable load-time modifications to classes, that ClassLoader must not attempt to use class data sharing.

See the Diagnostics Guide for more detail on this topic.

Operating system limitations

You cannot share classes between 32-bit and 64-bit JVMs. Temporary disk space must be available to hold cache information. The operating system enforces cache permissions.

For operating systems that can run both 32-bit and 64-bit applications, class data sharing is not permitted between 32-bit and 64-bit JVMs. The listAllCaches suboption lists 32-bit or 64-bit caches, depending on the address mode of the JVM being used.

The shared class cache requires disk space to store identification information about the caches that exist on the system. This information is in the user profile directory. If the identification information directory is deleted, the JVM cannot identify the shared classes on the system and must re-create the cache.

The operating system enforces the permissions for accessing a shared class cache. If you do not specify a cache name, the user name is appended to the default name so that multiple users on the same system create their own caches by default.

Using SharedClassPermission

If a SecurityManager is being used with class data sharing and the running application uses its own class loaders, you must grant these class loaders shared class permissions before they can share classes.

You add shared class permissions to the java.policy file using the ClassLoader class name (wildcards are permitted) and either "read", "write", or "read,write" to determine the access granted. For example:

permission com.ibm.oti.shared.SharedClassPermission
        "com.abc.customclassloaders.*", "read,write";

If a ClassLoader does not have the correct permissions, it is prevented from sharing classes. You cannot change the permissions of the default bootstrap, application, or extension class loaders.

Adapting custom classloaders to share classes

Any classloader that extends java.net.URLClassLoader can share classes without modification. You must adopt classloaders that do not extend java.net.URLClassLoader to share class data.

You must grant all custom classloaders shared class permissions if a SecurityManager is being used; see Using SharedClassPermission. IBM provides several Java interfaces for various types of custom classloaders, which allow the classloaders to find and store classes in the shared class cache. These classes are in the com.ibm.oti.shared package.

The Javadoc document for this package is provided with the SDK in the docs/content/apidoc directory.

See the Diagnostics Guide for more information about how to use these interfaces.

Java Communications API (JavaComm)

The Java Communications (API) package (JavaComm) is an optional package provided for use with the Runtime Environment for Windows. You install JavaComm independently of the SDK or Runtime Environment.

The JavaComm API gives Java applications a platform-independent way of performing serial and parallel port communications for technologies such as voice mail, fax, and smartcards.

The Java Communications API supports Electronic Industries Association (EIA)-232 (RS232) serial ports and Institute of Electrical and Electronics Engineers (IEEE) 1284 parallel ports and is supported on systems with the IBM Version 6 Runtime Environment.

Using the Java Communications API, you can:

Installing Java Communications API from a compressed file

Make sure that the SDK or Runtime Environment is installed before you install the Java Communications API.

About this task

To install the Java Communications API from a compressed file:

Procedure

  1. Put the Java Communications API compressed file, ibm-java-javacomm-3.0-0.0-win-i386.zip, in the directory where the SDK or Runtime Environment is installed. If you installed to the default directory, this is C:\Program Files\IBM\Java60\.
  2. Extract the compressed file. The Java Communications API is extracted into subdirectories in the existing directory.
  3. Copy the Java Communications API files into the correct directories in your SDK.
    1. Copy lib\win32com.dll to your jre\bin\ directory.
    2. Copy jar\comm.jar to your jre\lib\ext\ directory.
    3. Copy lib\javax.comm.properties to your jre\lib\ directory.
    By default, the SDK is installed in the C:\Program Files\IBM\Java60\ directory.

Configuring the Java Communications API

To use the Java Communications API, you must change the access mode of serial and parallel ports, and set the PATH if you did not set it when you installed Java.

About this task

See Setting the path.

Specifying devices in the javax.comm.properties file

Use the javax.comm.properties file to specify the drivers that are available to the Java Communications API and whether they are parallel or serial. Do not change this file without a very clear understanding of its use.

About this task

The following properties must be defined:

driver=<driver_name>

For example:

# Implementation specific driver
driver=com.sun.comm.Win32Driver

Printing limitation with the Java Communications API

When printing with the Java Communications API, you might have to select "Form feed", "Continue", or a similar option on the printer.

Uninstalling Java Communications API

To uninstall the Java Communications API, delete the following files from the directory where you installed the Runtime Environment:

About this task

By default, the Runtime Environment is installed in the C:\Program Files\IBM\Java60\ directory.

The Java Communications API documentation

You can find API documentation and samples for the Java Communications API at the Sun Web site.

http://java.sun.com/products/javacomm/.

Service and support for independent software vendors

Contact points for service:

If you are entitled to services for the Program code pursuant to the IBM Solutions Developer Program, contact the IBM Solutions Developer Program through your usual method of access or on the Web at: http://www.ibm.com/partnerworld/.

If you have purchased a service contract (that is, the IBM Personal Systems Support Line or equivalent service by country), the terms and conditions of that service contract determine what services, if any, you are entitled to receive with respect to the Program.

Accessibility

The user guides that are supplied with this SDK and the Runtime Environment have been tested using screen readers.

To change the font sizes in the user guides, use the function that is supplied with your browser, typically found under the View menu option.

For users who require keyboard navigation, a description of useful keystrokes for Swing applications is in Swing Key Bindings at http://www.ibm.com/developerworks/java/jdk/additional/.

Keyboard traversal of JComboBox components in Swing

If you traverse the drop-down list of a JComboBox component with the cursor keys, the button or editable field of the JComboBox does not change value until an item is selected. This is the correct behavior for this release and improves accessibility and usability by ensuring that the keyboard traversal behavior is consistent with mouse traversal behavior.

Web Start accessibility

From Version 5.0, Java Web Start contains several accessibility and usability improvements, including better support for screen readers and improved keyboard navigation.

You can use the command line to start a Java application that is enabled for Web Start. To change preference options, you must edit a configuration file, Application Data\IBM\Java\Deployment\deployment.properties in the user's home directory. Take a backup before you edit this file. Not all of the preferences that can be set in the Java Application Cache Viewer are available in the configuration file.

General note about security

You can obtain JCE unrestricted jurisdiction policy files from http://www.ibm.com/developerworks/java/jdk/security/index.html. Documentation about the IBM security packages JCE, JCEFIPS, JSSE2, JSSEFIPS, JGSS, JAAS and hardware cryptography is also available at this Web site.

Any comments on this user guide?

If you have any comments about this user guide, contact us through one of the following channels. Note that these channels are not set up to answer technical queries, but are for comments about the documentation only.

Send your comments:

The fine print. By choosing to send a message to IBM, you acknowledge that all information contained in your message, including feedback data, such as questions, comments, suggestions, or the like, shall be deemed to be non-confidential and IBM shall have no obligation of any kind with respect to such information and shall be free to reproduce, use, disclose, and distribute the information to others without limitation. Further, IBM shall be free to use any ideas, concepts, know-how or techniques contained in such information for any purpose whatsoever, including, but not limited to, developing, manufacturing and marketing products incorporating such information.

Appendix A. Command-line options

You can specify the options on the command line while you are starting Java. They override any relevant environment variables. For example, using -cp <dir1> with the Java command completely overrides setting the environment variable CLASSPATH=<dir2>.

Specifying command-line options

Although the command line is the traditional way to specify command-line options, you can pass options to the JVM in other ways.

Use only single or double quotation marks for command-line options when explicitly directed to do so for the option in question. Single and double quotation marks have different meanings on different platforms, operating systems, and shells. Do not use '-X<option>' or "-X<option>". Instead, you must use -X<option>. For example, do not use '-Xmx500m' and "-Xmx500m". Write this option as -Xmx500m.

These precedence rules (in descending order) apply to specifying options:

  1. Command line.

    For example, java -X<option> MyClass

  2. A file containing a list of options, specified using the -Xoptionsfile option on the command line. For example, java -Xoptionsfile=myoptionfile.txt MyClass

    In the options file, specify each option on a new line; you can use the '\' character as a continuation character if you want a single option to span multiple lines. Use the '#' character to define comment lines. You cannot specify -classpath in an options file. Here is an example of an options file:

    #My options file
    -X<option1>
    -X<option2>=\
    <value1>,\
    <value2>
    -D<sysprop1>=<value1>
  3. IBM_JAVA_OPTIONS environment variable. You can set command-line options using this environment variable. The options that you specify with this environment variable are added to the command line when a JVM starts in that environment.

    For example, set IBM_JAVA_OPTIONS=-X<option1> -X<option2>=<value1>

General command-line options

Use these options to print help on assert-related options, set the search path for application classes and resources, print a usage method, identify memory leaks inside the JVM, print the product version and continue, enable verbose output, and print the product version.

-cp, -classpath <directories and compressed or jar files separated by : (; on Windows)>
Sets the search path for application classes and resources. If -classpath and -cp are not used, and the CLASSPATH environment variable is not set, the user classpath is, by default, the current directory (.).
-help, -?
Prints a usage message.
-showversion
Prints product version and continues.
-verbose:<option>[,<option>...]
Enables verbose output. Separate multiple options using commas. These options are available:
class
Writes an entry to stderr for each class that is loaded.
dynload
Provides detailed information as each bootstrap class is loaded by the JVM:
  • The class name and package
  • For class files that were in a .jar file, the name and directory path of the .jar
  • Details of the size of the class and the time taken to load the class
The data is written out to stderr. An example of the output on a Windows platform follows:
<Loaded java/lang/String from C:\sdk\jre\lib\vm.jar>
<Class size 17258; ROM size 21080; debug size 0>
<Read time 27368 usec; Load time 782 usec; Translate time 927 usec>
gc
Provide verbose garbage collection information.
init
Writes information to stderr describing JVM initialization and termination.
jni
Writes information to stderr describing the JNI services called by the application and JVM.
sizes
Writes information to stderr describing the active memory usage settings.
stack
Writes information to stderr describing the Java and C stack usage for each thread.
-version
Prints product version.

System property command-line options

Use the system property command-line options to set up your system.

-D<name>=<value>
Sets a system property.
-Dcom.ibm.jsse2.renegotiate=[ALL | NONE | ABBREVIATED]
If your Java application uses JSSE for secure communication, you can disable TLS renegotiation by installing APAR IZ65239.
ALL
Allow both abbreviated and unabbreviated (full) renegotiation handshakes.
NONE
Allow no renegotiation handshakes. This is the default setting.
ABBREVIATED
Allow only abbreviated renegotiation handshakes.
-Dcom.ibm.lang.management.verbose
Enables verbose information from java.lang.management operations to be written to the console during VM operation.
-Dcom.ibm.mappedByteBufferForce=[true | false]
During system failure, the MappedByteBuffer.force API does not commit data to disk, which prevents data integrity issues. Setting this value to true will force data to be committed to disk during system failure. Because this setting can cause performance degradation, this switch is disabled by default.
-Dcom.ibm.rational.mvfs.checking=[true | false]
Use this property to improve the performance of MultiVersionFileSystem (MVFS) file systems. The WinNTFilesystem methods getModifiedTime and getBooleanAttributes use the windows methods API_wstati64() and _wfindfirsti64() instead of the defaults. This property is disabled by default because it can cause performance degradation on local file systems, and on remote Windows shares, where there is no Windows directory cache for the remote file system.
-Dcom.ibm.tools.attach.enable=yes
Enable the Attach API for this application. The Attach API allows your application to connect to a virtual machine. Your application can then load an agent application into the virtual machine. The agent can be used to perform tasks such as monitoring the virtual machine status.
-Dibm.jvm.bootclasspath
The value of this property is used as an additional search path, which is inserted between any value that is defined by -Xbootclasspath/p: and the bootclass path. The bootclass path is either the default or the one that you defined by using the -Xbootclasspath: option.
-Dibm.stream.nio=[true | false]
From v1.4.1 onwards, by default the IO converters are used. This option addresses the ordering of IO and NIO converters. When this option is set to true, the NIO converters are used instead of the IO converters.
-Djava.compiler=[ NONE | j9jit24 ]
Disables the Java compiler by setting to NONE. Enable JIT compilation by setting to j9jit24 (Equivalent to -Xjit).
-Djava.net.connectiontimeout=[n]
'n' is the number of seconds to wait for the connection to be established with the server. If this option is not specified in the command line, the default value of 0 (infinity) is used. The value can be used as a timeout limit when an asynchronous java-net application is trying to establish a connection with its server. If this value is not set, a java-net application waits until the default connection timeout value is met. For instance, java -Djava.net.connectiontimeout=2 TestConnect causes the java-net client application to wait only 2 seconds to establish a connection with its server.
-Dsun.net.client.defaultConnectTimeout=<value in milliseconds>
Specifies the default value for the connect timeout for the protocol handlers used by the java.net.URLConnection class. The default value set by the protocol handlers is -1, which means that no timeout is set.

When a connection is made by an applet to a server and the server does not respond properly, the applet might seem to hang and might also cause the browser to hang. This apparent hang occurs because there is no network connection timeout. To avoid this problem, the Java Plug-in has added a default value to the network timeout of 2 minutes for all HTTP connections. You can override the default by setting this property.

-Dsun.net.client.defaultReadTimeout=<value in milliseconds>
Specifies the default value for the read timeout for the protocol handlers used by the java.net.URLConnection class when reading from an input stream when a connection is established to a resource. The default value set by the protocol handlers is -1, which means that no timeout is set.
-Dsun.nio.MaxDirectMemorySize=<value in bytes>
Limits the native memory size for nio Direct Byte Buffer objects to the value specified.
-Dsun.rmi.transport.tcp.connectionPool=[true | any non-null value]
Enables thread pooling for the RMI ConnectionHandlers in the TCP transport layer implementation.
-Dswing.useSystemFontSettings=[false]
From v1.4.1 onwards, by default, Swing programs running with the Windows Look and Feel render with the system font set by the user instead of a Java-defined font. As a result, fonts for v1.4.1 differ from those in earlier releases. This option addresses compatibility problems like these for programs that depend on the old behavior. By setting this option, v1.4.1 fonts and those of earlier releases are the same for Swing programs running with the Windows Look and Feel.

JVM command-line options

Use these options to configure your JVM. The options prefixed with -X are nonstandard.

For options that take a <size> parameter, suffix the number with "k" or "K" to indicate kilobytes, "m" or "M" to indicate megabytes, or "g" or "G" to indicate gigabytes.

For options that take a <percentage> parameter, use a number from 0 to 1. For example, 50% is 0.5.

Options that relate to the JIT are listed under JIT and AOT command-line options. Options that relate to the Garbage Collector are listed under Garbage Collector command-line options.

-X
Displays help on nonstandard options.

-Xargencoding
You can put Unicode escape sequences in the argument list. This option is set to off by default.
-Xbootclasspath:<directories and compressed or Java archive files separated by : (; on Windows)>
Sets the search path for bootstrap classes and resources. The default is to search for bootstrap classes and resources in the internal VM directories and .jar files.
-Xbootclasspath/a:<directories and compressed or Java archive files separated by : (; on Windows)>
Appends the specified directories, compressed files, or jar files to the end of the bootstrap class path. The default is to search for bootstrap classes and resources in the internal VM directories and .jar files.
-Xbootclasspath/p:<directories and compressed or Java archive files separated by : (; on Windows)>
Adds a prefix of the specified directories, compressed files, or Java archive files to the front of the bootstrap class path. Do not deploy applications that use the -Xbootclasspath: or the -Xbootclasspath/p: option to override a class in the standard API. This is because such a deployment contravenes the Java 2 Runtime Environment binary code license. The default is to search for bootstrap classes and resources in the internal VM directories and .jar files.
-Xcheck:classpath
Displays a warning message if an error is discovered in the class path; for example, a missing directory or JAR file.
-Xcheck:gc[:<scan options>][:<verify options>][:<misc options>]
Performs additional checks on garbage collection. By default, no checking is performed. See the output of -Xcheck:gc:help for more information.
-Xcheck:jni[:help][:<option>=<value>]
Performs additional checks for JNI functions. This option is equivalent to -Xrunjnichk. By default, no checking is performed.
-Xcheck:memory[:<option>]
Identifies memory leaks inside the JVM using strict checks that cause the JVM to exit on failure. If no option is specified, all is used by default. The available options are as follows:
all
Enables checking of all allocated and freed blocks on every free and allocate call. This check of the heap is the most thorough. It typically causes the JVM to exit on nearly all memory-related problems soon after they are caused. This option has the greatest affect on performance.
callsite=<number of allocations>

Displays callsite information every <number of allocations>. Deallocations are not counted. Callsite information is presented in a table with separate information for each callsite. Statistics include:

  • The number and size of allocation and free requests since the last report.
  • The number of the allocation request responsible for the largest allocation from each site.

Callsites are presented as sourcefile:linenumber for C code and assembly function name for assembler code.

Callsites that do not provide callsite information are accumulated into an "unknown" entry.

failat=<number of allocations>
Causes memory allocation to fail (return NULL) after <number of allocations>. Setting <number of allocations> to 13 causes the 14th allocation to return NULL. Deallocations are not counted. Use this option to ensure that JVM code reliably handles allocation failures. This option is useful for checking allocation site behavior rather than setting a specific allocation limit.
ignoreUnknownBlocks
Ignores attempts to free memory that was not allocated using the -Xcheck:memory tool. Instead, the -Xcheck:memory statistics printed out at the end of a run indicates the number of "unknown" blocks that were freed.
mprotect=<top|bottom>
Locks pages of memory on supported platforms, causing the program to stop if padding before or after the allocated block is accessed for reads or writes. An extra page is locked on each side of the block returned to the user.

If you do not request an exact multiple of one page of memory, a region on one side of your memory is not locked. The top and bottom options control which side of the memory area is locked. top aligns your memory blocks to the top of the page, so buffer underruns result in an application failure. bottom aligns your memory blocks to the bottom of the page so buffer overruns result in an application failure.

Standard padding scans detect buffer underruns when using top and buffer overruns when using bottom.

nofree
Keeps a list of blocks already used instead of freeing memory. This list is checked, as well as currently allocated blocks, for memory corruption on every allocation and deallocation. Use this option to detect a dangling pointer (a pointer that is "dereferenced" after its target memory is freed). This option cannot be reliably used with long-running applications (such as WebSphere Application Server), because "freed" memory is never reused or released by the JVM.
noscan
Checks for blocks that are not freed. This option has little effect on performance, but memory corruption is not detected. This option is compatible only with subAllocator, callsite, and callsitesmall.
quick
Enables block padding only and is used to detect basic heap corruption. Every allocated block is padded with sentinel bytes, which are verified on every allocate and free. Block padding is faster than the default of checking every block, but is not as effective.
skipto=<number of allocations>
Causes the program to check only on allocations that occur after <number of allocations>. Deallocations are not counted. Use this option to speed up JVM startup when early allocations are not causing the memory problem. The JVM performs approximately 250+ allocations during startup.
subAllocator[=<size in MB>]
Allocates a dedicated and contiguous region of memory for all JVM allocations. This option helps to determine if user JNI code or the JVM is responsible for memory corruption. Corruption in the JVM subAllocator heap suggests that the JVM is causing the problem; corruption in the user-allocated memory suggests that user code is corrupting memory. Typically, user and JVM allocated memory are interleaved.
zero
Newly allocated blocks are set to 0 instead of being filled with the 0xE7E7xxxxxxxxE7E7 pattern. Setting these blocks to 0 helps you to determine whether a callsite is expecting zeroed memory, in which case the allocation request is followed by memset(pointer, 0, size).
-Xclassgc
Enables dynamic unloading of classes by the JVM. This is the default behavior. To disable dynamic class unloading, use the -Xnoclassgc option.
-Xcompressedrefs
(64-bit only) Uses 32-bit values for references. See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section on "Compressed references" for more information. By default, references are 64-bit.
-Xdbg:<options>
Loads debugging libraries to support the remote debugging of applications. This option is equivalent to -Xrunjdwp. By default, the debugging libraries are not loaded, and the VM instance is not enabled for debug.
-Xdebug
This option is deprecated. Use -Xdbg for debugging.
-Xdiagnosticscollector[:settings=<filename>]
Enables the Diagnostics Collector. See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section on "The Diagnostics Collector" for more information. The settings option allows you to specify a different Diagnostics Collector settings file to use instead of the default dc.properties file in the JRE.
-Xdisablejavadump
Turns off Javadump generation on errors and signals. By default, Javadump generation is enabled.
-Xdump
See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section on "Using dump agents" for more information.
-Xenableexplicitgc
Signals to the VM that calls to System.gc() trigger a garbage collection. This option is enabled by default.
-Xfuture
Turns on strict class-file format checks. Use this flag when you are developing new code because stricter checks will become the default in future releases. By default, strict format checks are disabled.
-Xiss<size>
Sets the initial stack size for Java threads. By default, the stack size is set to 2 KB. Use the -verbose:sizes option to output the value that the VM is using.
-Xjarversion
Produces output information about the version of each jar file in the class path, the boot class path, and the extensions directory. Version information is taken from the Implementation-Version and Build-Level properties in the manifest of the jar.
-Xjni:<suboptions>
Sets JNI options. You can use the following suboption with the -Xjni option:
-Xjni:arrayCacheMax=[<size in bytes>|unlimited]
Sets the maximum size of the array cache. The default size is 8096 bytes.
-Xlinenumbers
Displays line numbers in stack traces for debugging. See also -Xnolinenumbers. By default, line numbers are on.

-Xlog

Enables message logging. To prevent message logging, use the -Xlog:none option. By default, logging is enabled. This option is available from Java 6 SR5. See Messages.

-Xlp<size>
Windows: Requests the JVM to allocate the Java heap with large pages. This command is available only on Windows Server 2003, Windows Vista, and Windows Server 2008. To use large pages, the user that runs Java must have the authority to "lock pages in memory". To enable this authority, as Administrator go to Control Panel -> Administrative Tools -> Local Security Policy and then find Local Policies -> User Rights Assignment -> Lock pages in memory. Add the user who runs the Java process, and reboot your machine. For more information, see these Web sites:
Note: On Microsoft Windows Vista and Windows 2008, use of large pages is affected by the User Account Control (UAC) feature. When UAC is enabled, a regular user (a member of the Users group) can use the -Xlp option as normal. However, an administrative user (a member of the Administrators group) must run the application as an administrator to gain the privileges required to lock pages in memory. To run as administrator, right-click the application and select Run as administrator. If the user does not have the necessary privileges, an error message is produced, advising that the System configuration does not support option '-Xlp'.

AIX®, Linux®, and Windows only: If a <size> is specified, the JVM attempts to allocate the JIT code cache memory using pages of that size. If unsuccessful, or if executable pages of that size are not supported, the JIT code cache memory is allocated using the smallest available executable page size.

-Xmso<size>
Start of changeSets the initial stack size for operating system threads. The default value can be determined by running the command:
java -verbose:sizes
The maximum value for the stack size varies according to platform and specific machine configuration. If you exceed the maximum value, a java/lang/OutOfMemoryError message is reported.
End of change
-Xnoagent
Disables support for the old JDB debugger.
-Xnoclassgc
Disables dynamic class unloading. This option disables the release of native and Java heap storage associated with Java class loaders and classes that are no longer being used by the JVM. The default behavior is as defined by -Xclassgc. Enabling this option is not recommended except under the direction of the IBM Java support team. The reason is the option can cause unlimited native memory growth, leading to out-of-memory errors.
-Xnolinenumbers
Disables the line numbers for debugging. See also -Xlinenumbers. By default, line number are on.
-Xnosigcatch
Disables JVM signal handling code. See also -Xsigcatch. By default, signal handling is enabled.
-Xnosigchain
Disables signal handler chaining. See also -Xsigchain. By default, the signal handler chaining is enabled.
-Xoptionsfile=<file>

Specifies a file that contains JVM options and definitions. By default, no option file is used.

The options file does not support these options:

<file> contains options that are processed as if they had been entered directly as command-line options. For example, the options file might contain:

-DuserString=ABC123
-Xmx256MB

Some options use quoted strings as parameters. Do not split quoted strings over multiple lines using the line continuation character '\'. The '¥' character is not supported as a line continuation character. For example, the following example is not valid in an options file:

-Xevents=vmstop,exec="cmd /c \
echo %pid has finished."

The following example is valid in an options file:

-Xevents=vmstop, \
exec="cmd /c echo %pid has finished."
-Xoss<size>
Start of changeRecognized but deprecated. Use -Xss and -Xmso. Sets the maximum Java stack size for any thread. The maximum value for the stack size varies according to platform and specific machine configuration. If you exceed the maximum value, a java/lang/OutOfMemoryError message is reported.End of change
-Xrdbginfo:<host>:<port>
Loads the remote debug information server with the specified host and port. By default, the remote debug information server is disabled.
-Xrs
Disables signal handling in the JVM. Setting -Xrs prevents the Java runtime from handling any internally or externally generated signals such as SIGSEGV and SIGABRT. Any signals raised are handled by the default operating system handlers.
-Xrun<library name>[:<options>]
Loads helper libraries. To load multiple libraries, specify it more than once on the command line. Examples of these libraries are:
-Xrunhprof[:help] | [:<option>=<value>, ...]
Performs heap, CPU, or monitor profiling.
-Xrunjdwp[:help] | [:<option>=<value>, ...]
Loads debugging libraries to support the remote debugging of applications. This option is the same as -Xdbg.
-Xrunjnichk[:help] | [:<option>=<value>, ...]
Deprecated. Use -Xcheck:jni instead.
-Xscmx<size>
Specifies cache size. This option applies only if a cache is being created and no cache of the same name exists. The default cache size is platform-dependent. You can find out the size value being used by adding -verbose:sizes as a command-line argument. Minimum cache size is 4 KB. Maximum cache size is platform-dependent. The size of cache that you can specify is limited by the amount of physical memory and paging space available to the system. The virtual address space of a process is shared between the shared classes cache and the Java heap. Increasing the maximum size of the Java heap reduces the size of the shared classes cache that you can create.
-XselectiveDebug
Enables selective debugging. Use the com.ibm.jvm.Debuggable annotation to mark classes and methods that must be available for debugging. The JVM optimizes methods that do not need debugging to provide better performance in a debugging environment. See the User Guide for your platform for more information.
-Xshareclasses:<suboptions>

Enables class sharing. This option can take a number of suboptions, some of which are cache utilities. Cache utilities perform the required operation on the specified cache, without starting the VM. You can combine multiple suboptions, separated by commas, but the cache utilities are mutually exclusive.

You can use the following suboptions with the -Xshareclasses option:

cacheDir=<directory>
Sets the directory in which cache data is read and written. By default, <directory> is the user's C:\Documents and Settings\<username>\Local Settings\Application Data\javasharedresources directory on Windows or /tmp/javasharedresources on Linux, AIX, z/OS®, and IBM i. You must have sufficient permissions in <directory>. The JVM writes persistent cache files directly into the directory specified. Persistent cache files can be safely moved and deleted from the file system. Nonpersistent caches are stored in shared memory and have control files that describe the location of the memory. Control files are stored in a javasharedresources subdirectory of the cacheDir specified. Do not move or delete control files in this directory. The listAllCaches utility, the destroyAll utility, and the expire suboption work only in the scope of a given cacheDir.
cacheRetransformed
Enables caching of classes that have been transformed using the JVMTI RetransformClasses function. See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section on the "JVMTI redefinition and retransformation of classes" for more information.
destroy (Utility option)
Destroys a cache specified by the name, cacheDir, and nonpersistent suboptions. A cache can be destroyed only if all JVMs using it have shut down and the user has sufficient permissions.
destroyAll (Utility option)
Tries to destroy all caches available using the specified cacheDir and nonpersistent suboptions. A cache can be destroyed only if all JVMs using it have shut down and the user has sufficient permissions.
expire=<time in minutes> (Utility option)
Destroys all caches that have been unused for the time specified before loading shared classes. This option is not a utility option because it does not cause the JVM to exit. On NTFS file systems, the expire option is accurate to the nearest hour.
groupAccess
Sets operating system permissions on a new cache to allow group access to the cache. The default is user access only.
help
Lists all the command-line options.
listAllCaches (Utility option)
Lists all the compatible and incompatible caches that exist in the specified cache directory. If you do not specify cacheDir, the default directory is used. Summary information, such as Java version and current usage, is displayed for each cache.
mprotect=[all | default | none]
By default, the memory pages containing the cache are protected at all times, unless a specific page is being updated. This protection helps prevent accidental or deliberate corruption to the cache. The cache header is not protected by default because this protection has a small performance cost. Specifying all ensures that all the cache pages are protected, including the header. Specifying none disables the page protection.
modified=<modified context>
Used when a JVMTI agent is installed that might modify bytecode at run time. If you do not specify this suboption and a bytecode modification agent is installed, classes are safely shared with an extra performance cost. The <modified context> is a descriptor chosen by the user; for example, myModification1. This option partitions the cache, so that only JVMs using context myModification1 can share the same classes. For instance, if you run an application with a modification context and then run it again with a different modification context, all classes are stored twice in the cache. See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section "Dealing with runtime bytecode modification" for more information.
name=<name>
Connects to a cache of a given name, creating the cache if it does not exist. This option is also used to indicate the cache that is to be modified by cache utilities; for example, destroy. Use the listAllCaches utility to show which named caches are currently available. If you do not specify a name, the default name "sharedcc_%u" is used. "%u" in the cache name inserts the current user name.
noaot
Disables caching and loading of AOT code.
noBootclasspath
Disables the storage of classes loaded by the bootstrap class loader in the shared classes cache. Often used with the SharedClassURLFilter API to control exactly which classes are cached. See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section on the "SharedClassHelper API" for more information about shared class filtering.
none
Added to the end of a command line, disables class data sharing. This suboption overrides class sharing arguments found earlier on the command line.
nonfatal
Allows the JVM to start even if class data sharing fails. Normal behavior for the JVM is to refuse to start if class data sharing fails. If you select nonfatal and the shared classes cache fails to initialize, the JVM attempts to connect to the cache in read-only mode. If this attempt fails, the JVM starts without class data sharing.
nonpersistent
Uses a nonpersistent cache. The cache is lost when the operating system shuts down. Nonpersistent and persistent caches can have the same name. You must always use the nonpersistent suboption when running utilities such as destroy on a nonpersistent cache.
persistent (default for Windows and Linux platforms)
Uses a persistent cache. The cache is created on disk, which persists beyond operating system restarts. Nonpersistent and persistent caches can have the same name.
printAllStats (Utility option)
Displays detailed information about the contents of the cache specified in the name=<name> suboption. If the name is not specified, statistics are displayed about the default cache. Every class is listed in chronological order with a reference to the location from which it was loaded. See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section on the "printAllStats utility" for more information.
printStats (Utility option)
Displays summary information for the cache specified by the name, cacheDir, and nonpersistent suboptions. The most useful information displayed is how full the cache is and how many classes it contains. Stale classes are classes that have been updated on the file system and which the cache has therefore marked "stale". Stale classes are not purged from the cache and can be reused. See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section on the "printStats utility" for more information.
readonly
Opens an existing cache with read-only permissions. The JVM does not create a new cache with this suboption. Opening a cache read-only prevents the JVM from making any updates to the cache. It also allows the JVM to connect to caches created by other users or groups without requiring write access. By default, this suboption is not specified.
reset
Causes a cache to be destroyed and then re-created when the JVM starts up. This option can be added to the end of a command line as -Xshareclasses:reset.
safemode
Forces the JVM to load all classes from disk and apply the modifications to those classes (if applicable). See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section on "Using the safemode option" for more information.
silent
Disables all shared class messages, including error messages. Unrecoverable error messages, which prevent the JVM from initializing, are displayed.
verbose
Gives detailed output on the cache I/O activity, listing information about classes being stored and found. Each class loader is given a unique ID (the bootstrap loader is always 0) and the output shows the class loader hierarchy at work, where class loaders must ask their parents for a class before they can load it themselves. It is typical to see many failed requests; this behavior is expected for the class loader hierarchy. The standard option -verbose:class also enables class sharing verbose output if class sharing is enabled.
verboseAOT
Enables verbose output when compiled AOT code is being found or stored in the cache. AOT code is generated heuristically. You might not see any AOT code generated at all for a small application. You can disable AOT caching using the noaot suboption. See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section on "JITM messages" for a list of the messages produced.
verboseHelper
Enables verbose output for the Java Helper API. This output shows you how the Helper API is used by your ClassLoader.
verboseIO
Gives detailed output on the cache I/O activity, listing information about classes being stored and found. Each class loader is given a unique ID (the bootstrap loader is always 0) and the output shows the class loader hierarchy at work, where class loaders must ask their parents for a class before they can load it themselves. It is typical to see many failed requests; this behavior is expected for the class loader hierarchy.
-Xsigcatch
Enables VM signal handling code. See also -Xnosigcatch. By default, signal handling is enabled.
-Xsigchain
Enables signal handler chaining. See also -Xnosigchain. By default, signal handler chaining is enabled.
-Xss<size>
Sets the maximum stack size for Java threads. The default is 256 KB for 32-bit JVMs and 512 KB for 64-bit JVMs.Start of change The maximum value varies according to platform and specific machine configuration. If you exceed the maximum value, a java/lang/OutOfMemoryError message is reported.End of change
-Xssi<size>
Sets the stack size increment for Java threads. When the stack for a Java thread becomes full it is increased in size by this value until the maximum size (-Xss) is reached. The default is 16 KB.
-Xthr:minimizeUserCPU
Minimizes user-mode CPU usage in thread synchronization where possible. The reduction in CPU usage might be a trade-off in exchange for lower performance.

-Xtrace[:help] | [:<option>=<value>, ...]
See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section on the "Controlling the trace" for more information.
-Xverify[:<option>]
With no parameters, enables the verifier, which is the default. Therefore, if used on its own with no parameters, for example, -Xverify, this option does nothing. Optional parameters are as follows: The verifier is on by default and must be enabled for all production servers. Running with the verifier off is not a supported configuration. If you encounter problems and the verifier was turned off using -Xverify:none, remove this option and try to reproduce the problem.
-Xzero[:<option>]

Enables reduction of the memory footprint of Java when concurrently running multiple Java invocations. -Xzero might not be appropriate for all types of applications because it changes the implementation of java.util.ZipFile, which might cause extra memory usage. -Xzero includes the optional parameters:

Because future versions might include more default options, -Xzero options are used to specify the suboptions that you want to disable. By default, -Xzero enables j9zip and sharezip. A combination of j9zip and sharezip enables all jar files to have shared caches:

-Xzero is available only in Java 6 SR1 and beyond. When enabled, the system property com.ibm.zero.version is defined, and has a current value of 1. For Java 6 SR1 and Java 6 SR2, the -Xzero option is accepted only on Windows x86-32 and Linux x86-32 platforms. From Java 6 SR3, -Xzero is accepted on all platforms; however, it is enabled only on Windows x86-32 and Linux x86-32 platforms.

-XX command-line options

JVM command-line options that are specified with -XX are not stable and are not recommended for casual use.

These options are subject to change without notice.

-XXallowvmshutdown:[false|true]
This option is provided as a workaround for customer applications that cannot shut down cleanly, as described in APAR IZ59734. Customers who need this workaround should use -XXallowvmshutdown:false. The default option is -XXallowvmshutdown:true forJava 6 SR5 onwards.
-XX:MaxDirectMemorySize=<size>
Sets the maximum size for an nio direct buffer. By default, the maximum size is 64 MB.
-XX:-StackTraceInThrowable
This option removes stack traces from exceptions. By default, stack traces are available in exceptions. Including a stack trace in exceptions requires walking the stack and that can affect performance. Removing stack traces from exceptions can improve performance but can also make problems harder to debug.

When this option is enabled, Throwable.getStackTrace() returns an empty array and the stack trace is displayed when an uncaught exception occurs. Thread.getStackTrace() and Thread.getAllStackTraces() are not affected by this option.

-XX:+UseCompressedOops
(64-bit only) This option enables compressed references in 64-bit JVMs and is provided to help when porting applications from the Sun JVM to the IBM JVM. This option might not be supported in subsequent releases. The -XX:+UseCompressedOops option is similar to specifying -Xcompressedrefs, which is detailed in the topic JVM command-line options .
-XX:-UseCompressedOops
(64-bit only) This option prevents the use of compressed references in 64-bit JVMs. The option is provided to help when porting applications from the Sun JVM to the IBM JVM, and might not be supported in subsequent releases.

JIT and AOT command-line options

Use these JIT and AOT compiler command-line options to control code compilation.

You might need to read the section on JIT and AOT problems in the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) to understand some of the references that are given here.

-Xaot[:<parameter>=<value>, ...]
With no parameters, enables the AOT compiler. The AOT compiler is enabled by default but is not active unless shared classes are enabled. Using this option on its own has no effect. Use this option to control the behavior of the AOT compiler. These parameters are useful:
count=<n>
Where <n> is the number of times a method is called before it is compiled. For example, setting count=0 forces the AOT compiler to compile everything on first execution.
limitFile=(<filename>,<m>,<n>)
Compile only the methods listed on lines <m> to <n> in the specified limit file. Methods not listed in the limit file and methods listed on lines outside the range are not compiled.
loadExclude=<methods>
Do not load methods beginning with <methods>.
loadLimit=<methods>
Load methods beginning with <methods> only.
loadLimitFile=(<filename>,<m>,<n>)
Compile only the methods listed on lines <m> to <n> in the specified limit file. Methods not listed in the limit file and methods listed on lines outside the range are not compiled.
verbose
Displays information about the AOT and JIT compiler configuration and method compilation.
-Xcodecache<size>
Sets the size of each block of memory that is allocated to store native code of compiled Java methods. By default, this size is selected internally according to the CPU architecture and the capability of your system. If profiling tools show significant costs in trampolines (JVMTI identifies trampolines in a methodLoad2 event), that is a good prompt to change the size until the costs are reduced. Changing the size does not mean always increasing the size. The option provides the mechanism to tune for the right size until hot interblock calls are eliminated. A reasonable starting point to tune for the optimal size is (totalNumberByteOfCompiledMethods * 1.1). This option is used to tune performance.
-Xint
Makes the JVM use the Interpreter only, disabling the Just-In-Time (JIT) and Ahead-Of-Time (AOT) compilers. By default, the JIT compiler is enabled. By default, the AOT compiler is enabled, but is not used by the JVM unless shared classes are also enabled.
-Xjit[:<parameter>=<value>, ...]
With no parameters, enables the JIT compiler. The JIT compiler is enabled by default, so using this option on its own has no effect. Use this option to control the behavior of the JIT compiler. Useful parameters are:
count=<n>
Where <n> is the number of times a method is called before it is compiled. For example, setting count=0 forces the JIT compiler to compile everything on first execution.
limitFile=(<filename>, <m>, <n>)
Compile only the methods listed on lines <m> to <n> in the specified limit file. Methods not listed in the limit file and methods listed on lines outside the range are not compiled.
optlevel=[ noOpt | cold | warm | hot | veryHot | scorching ]
Forces the JIT compiler to compile all methods at a specific optimization level. Specifying optlevel might have an unexpected effect on performance, including lower overall performance.
verbose
Displays information about the JIT and AOT compiler configuration and method compilation.
-Xnoaot
Turns off the AOT compiler and disables the use of AOT-compiled code. By default, the AOT compiler is enabled but is active only when shared classes are also enabled. Using this option does not affect the JIT compiler.
-Xnojit
Turns off the JIT compiler. By default, the JIT compiler is enabled. This option does not affect the AOT compiler. java -Xnojit -version displays JIT enabled if the AOT compiler is enabled.
-Xquickstart
Start of changeCauses the JIT compiler to run with a subset of optimizations. The effect is faster compilation times that improve startup time, but longer running applications might run slower. When the AOT compiler is active (both shared classes and AOT compilation enabled), -Xquickstart causes all methods to be AOT compiled. The AOT compilation improves the startup time of subsequent runs, but might reduce performance for longer running applications. -Xquickstart can degrade performance if it is used with long-running applications that contain hot methods. The implementation of -Xquickstart is subject to change in future releases. By default, -Xquickstart is disabled.End of change
-XsamplingExpirationTime<time>
Disables the JIT sampling thread after <time> seconds. When the JIT sampling thread is disabled, no CPU cycles are consumed by an idle JVM.
-Xscmaxaot<size>
Optionally applies a maximum number of bytes in the class cache that can be used for AOT data. This option is useful if you want a certain amount of cache space guaranteed for non-AOT data. If this option is not specified, the maximum limit for AOT data is the amount of free space in the cache. The value of this option must not be smaller than the value of -Xscminaot and must not be larger than the value of -Xscmx.
-Xscminaot<size>
Optionally applies a minimum number of bytes in the class cache to reserve for AOT data. If this option is not specified, no space is reserved for AOT data, although AOT data is still written to the cache until the cache is full or the -Xscmaxaot limit is reached. The value of this option must not exceed the value of -Xscmx or -Xscmaxaot. The value of -Xscminaot must always be considerably less than the total cache size, because AOT data can be created only for cached classes. If the value of -Xscminaot equals the value of -Xscmx, no class data or AOT data can be stored.

Garbage Collector command-line options

Use these Garbage Collector command-line options to control garbage collection.

You might need to read the section on "Memory management" in the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) to understand some of the references that are given here.

The -verbose:gc option detailed in the section on "-verbose:gc logging" in the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) is the main diagnostic aid that is available for runtime analysis of the Garbage Collector. However, additional command-line options are available that affect the behavior of the Garbage Collector and might aid diagnostics.

For options that take a <size> parameter, suffix the number with "k" or "K" to indicate kilobytes, "m" or "M" to indicate megabytes, or "g" or "G" to indicate gigabytes.

For options that take a <percentage> parameter, use a number from 0 to 1, for example, 50% is 0.5.

-Xalwaysclassgc
Always perform dynamic class unloading checks during global collection. The default behavior is as defined by -Xclassgc.
-Xclassgc
Enables the collection of class objects only on class loader changes. This behavior is the default.
-Xcompactexplicitgc
Enables full compaction each time System.gc() is called.
-Xcompactgc
Compacts on all garbage collections (system and global).

The default (no compaction option specified) makes the GC compact based on a series of triggers that attempt to compact only when it is beneficial to the future performance of the JVM.

-Xconcurrentbackground<number>
Specifies the number of low-priority background threads attached to assist the mutator threads in concurrent mark. The default is 0 on Linux zSeries® and 1 on all other platforms.
-Xconcurrentlevel<number>
Specifies the allocation "tax" rate. It indicates the ratio between the amount of heap allocated and the amount of heap marked. The default is 8.
-Xconcurrentslack<size>
Attempts to keep the specified amount of the heap space free in concurrent collectors by starting the concurrent operations earlier. This behavior can sometimes alleviate pause time problems in concurrent collectors at the cost of longer concurrent cycles, affecting total throughput. The default is 0, which is optimal for most applications.
-Xconmeter:<soa | loa | dynamic>
This option determines the usage of which area, LOA (Large Object Area) or SOA (Small Object Area), is metered and hence which allocations are taxed during concurrent mark. Using -Xconmeter:soa (the default) applies the allocation tax to allocations from the small object area (SOA). Using -Xconmeter:loa applies the allocation tax to allocations from the large object area (LOA). If -Xconmeter:dynamic is specified, the collector dynamically determines which area to meter based on which area is exhausted first, whether it is the SOA or the LOA.
-Xdisableexcessivegc
Disables the throwing of an OutOfMemory exception if excessive time is spent in the GC.
-Xdisableexplicitgc

Disables System.gc() calls.

Many applications still make an excessive number of explicit calls to System.gc() to request garbage collection. In many cases, these calls degrade performance through premature garbage collection and compactions. However, you cannot always remove the calls from the application.

The -Xdisableexplicitgc parameter allows the JVM to ignore these garbage collection suggestions. Typically, system administrators use this parameter in applications that show some benefit from its use.

By default, calls to System.gc() trigger a garbage collection.

-Xdisablestringconstantgc
Prevents strings in the string intern table from being collected.
-Xenableexcessivegc
If excessive time is spent in the GC, the option returns null for an allocate request and thus causes an OutOfMemory exception to be thrown. This action occurs only when the heap has been fully expanded and the time spent is making up at least 95%. This behavior is the default.
-Xenablestringconstantgc
Enables strings from the string intern table to be collected. This behavior is the default.
-Xgc:<options>
Passes options such as verbose, compact, and nocompact to the Garbage Collector.
-Xgc:splitheap
Allocates the new and old areas of the generational Java heap in separate areas of memory. Using a split heap forces the Garbage Collector to use the gencon policy and disables resizing of the new and old memory areas. See the section on the "Split heap" in the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) for more information. By default, the Java heap is allocated in a single contiguous area of memory.
-Xgcpolicy:<optthruput | optavgpause | gencon | subpool (AIX, Linux and IBM i on IBM POWER® architecture, Linux and z/OS on zSeries) >
Controls the behavior of the Garbage Collector.

The optthruput option is the default and delivers high throughput to applications, but at the cost of occasional pauses. Disables concurrent mark.

The optavgpause option reduces the time that is spent in these garbage collection pauses and limits the effect of increasing heap size on the length of the garbage collection pause. Use optavgpause if your configuration has a large heap. Enables concurrent mark.

The gencon option requests the combined use of concurrent and generational GC to help minimize the time that is spent in any garbage collection pause.

The subpool option (AIX, Linux and IBM i on IBM POWER architecture, and z/OS) uses an improved object allocation algorithm to achieve better performance when allocating objects on the heap. This option might improve performance on large SMP systems.

-Xgcthreads<number>
Sets the number of threads that the Garbage Collector uses for parallel operations. This total number of GC threads is composed of one application thread with the remainder being dedicated GC threads. By default, the number is set to the number of physical CPUs present. To set it to a different number (for example 4), use -Xgcthreads4. The minimum valid value is 1, which disables parallel operations, at the cost of performance. No advantage is gained if you increase the number of threads above the default setting; you are recommended not to do so.

On systems running multiple JVMs or in LPAR environments where multiple JVMs can share the same physical CPUs, you might want to restrict the number of GC threads used by each JVM. The restriction helps prevent the total number of parallel operation GC threads for all JVMs exceeding the number of physical CPUs present, when multiple JVMs perform garbage collection at the same time.

-Xgcworkpackets<number>
Specifies the total number of work packets available in the global collector. If not specified, the collector allocates a number of packets based on the maximum heap size.
-Xloa
Allocates a large object area (LOA). Objects are allocated in this LOA rather than the SOA. By default, the LOA is enabled for all GC policies except for subpool, where the LOA is not available.
-Xloainitial<percentage>
Specifies the initial percentage (between 0 and 0.95) of the current tenure space allocated to the large object area (LOA). The default value is 0.05, which is 5%.
-Xloamaximum<percentage>
Specifies the maximum percentage (between 0 and 0.95) of the current tenure space allocated to the large object area (LOA). The default value is 0.5, which is 50%.
-Xloaminimum<percentage>
Specifies the minimum percentage (between 0 and 0.95) of the current tenure space allocated to the large object area (LOA). The LOA does not shrink below this value. The default value is 0, which is 0%.
-Xmaxe<size>
Sets the maximum amount by which the garbage collector expands the heap. Typically, the garbage collector expands the heap when the amount of free space falls below 30% (or by the amount specified using -Xminf), by the amount required to restore the free space to 30%. The -Xmaxe option limits the expansion to the specified value; for example -Xmaxe10M limits the expansion to 10 MB. By default, there is no maximum expansion size.
-Xmaxf<percentage>
Specifies the maximum percentage of heap that must be free after a garbage collection. If the free space exceeds this amount, the JVM tries to shrink the heap. The default value is 0.6 (60%).
-Xmaxt<percentage>
Specifies the maximum percentage of time to be spent in Garbage Collection. If the percentage of time rises above this value, the JVM tries to expand the heap. The default value is 13%.
-Xmca<size>
Sets the expansion step for the memory allocated to store the RAM portion of loaded classes. Each time more memory is required to store classes in RAM, the allocated memory is increased by this amount. By default, the expansion step is 32 KB. Use the -verbose:sizes option to determine the value that the VM is using. Start of changeIf the expansion step size you choose is too large, OutOfMemoryError is reported. The exact value of a "too large" expansion step size varies according to the platform and the specific machine configuration.End of change
-Xmco<size>
Sets the expansion step for the memory allocated to store the ROM portion of loaded classes. Each time more memory is required to store classes in ROM, the allocated memory is increased by this amount. By default, the expansion step is 128 KB. Use the -verbose:sizes option to determine the value that the VM is using. Start of changeIf the expansion step size you choose is too large, OutOfMemoryError is reported. The exact value of a "too large" expansion step size varies according to the platform and the specific machine configuration.End of change
-Xmine<size>
Sets the minimum amount by which the Garbage Collector expands the heap. Typically, the garbage collector expands the heap by the amount required to restore the free space to 30% (or the amount specified using -Xminf). The -Xmine option sets the expansion to be at least the specified value; for example, -Xmine50M sets the expansion size to a minimum of 50 MB. By default, the minimum expansion size is 1 MB.
-Xminf<percentage>
Specifies the minimum percentage of heap to be left free after a garbage collection. If the free space falls below this amount, the JVM attempts to expand the heap. The default value is 30%.
-Xmint<percentage>
Specifies the minimum percentage of time to spend in Garbage Collection. If the percentage of time drops below this value, the JVM tries to shrink the heap. The default value is 5%.
-Xmn<size>
Sets the initial and maximum size of the new area to the specified value when using -Xgcpolicy:gencon. Equivalent to setting both -Xmns and -Xmnx. If you set either -Xmns or -Xmnx, you cannot set -Xmn. If you try to set -Xmn with either -Xmns or -Xmnx, the VM does not start, returning an error. By default, -Xmn is not set. If the scavenger is disabled, this option is ignored.
-Xmns<size>
Sets the initial size of the new area to the specified value when using -Xgcpolicy:gencon. By default, this option is set to 25% of the value of the -Xms option. This option returns an error if you try to use it with -Xmn. You can use the -verbose:sizes option to find out the values that the VM is currently using. If the scavenger is disabled, this option is ignored.
-Xmnx<size>
Sets the maximum size of the new area to the specified value when using -Xgcpolicy:gencon. By default, this option is set to 25% of the value of the -Xmx option. This option returns an error if you try to use it with -Xmn. You can use the -verbose:sizes option to find out the values that the VM is currently using. If the scavenger is disabled, this option is ignored.
-Xmo<size>
Sets the initial and maximum size of the old (tenured) heap to the specified value when using -Xgcpolicy:gencon. Equivalent to setting both -Xmos and -Xmox. If you set either -Xmos or -Xmox, you cannot set -Xmo. If you try to set -Xmo with either -Xmos or -Xmox, the VM does not start, returning an error. By default, -Xmo is not set.
-Xmoi<size>
Sets the amount the Java heap is incremented when using -Xgcpolicy:gencon. If set to zero, no expansion is allowed. By default, the increment size is calculated on the expansion size, set by -Xmine and -Xminf.
-Xmos<size>
Sets the initial size of the old (tenure) heap to the specified value when using -Xgcpolicy:gencon. By default, this option is set to 75% of the value of the -Xms option. This option returns an error if you try to use it with -Xmo. You can use the -verbose:sizes option to find out the values that the VM is currently using.
-Xmox<size>
Sets the maximum size of the old (tenure) heap to the specified value when using -Xgcpolicy:gencon. By default, this option is set to the same value as the -Xmx option. This option returns an error if you try to use it with -Xmo. You can use the -verbose:sizes option to find out the values that the VM is currently using.
-Xmr<size>
Sets the size of the Garbage Collection "remembered set". This set is a list of objects in the old (tenured) heap that have references to objects in the new area. By default, this option is set to 16 K.
-Xmrx<size>
Sets the remembered maximum size setting.
-Xms<size>
Sets the initial Java heap size. You can also use the -Xmo option. The minimum size is 1 MB.

If scavenger is enabled, -Xms >= -Xmn + -Xmo.

If scavenger is disabled, -Xms >= -Xmo.

-Xmx<size>
Sets the maximum memory size (-Xmx >= -Xms)

Examples of the use of -Xms and -Xmx:

-Xms2m -Xmx64m
Heap starts at 2 MB and grows to a maximum of 64 MB.
-Xms100m -Xmx100m
Heap starts at 100 MB and never grows.
-Xms20m -Xmx1024m
Heap starts at 20 MB and grows to a maximum of 1 GB.
-Xms50m
Heap starts at 50 MB and grows to the default maximum.
-Xmx256m
Heap starts at default initial value and grows to a maximum of 256 MB.
-Xnoclassgc
Disables class garbage collection. This option switches off garbage collection of storage associated with Java classes that are no longer being used by the JVM. The default behavior is as defined by -Xclassgc. By default, class garbage collection is performed.
-Xnocompactexplicitgc
Disables compaction on System.gc() calls. Compaction takes place on global garbage collections if you specify -Xcompactgc or if compaction triggers are met. By default, compaction is enabled on calls to System.gc().
-Xnocompactgc
Disables compaction on all garbage collections (system or global). By default, compaction is enabled.
-Xnoloa
Prevents allocation of a large object area; all objects are allocated in the SOA. See also -Xloa.
-Xnopartialcompactgc
Disables incremental compaction. See also -Xpartialcompactgc.
-Xpartialcompactgc
Enables incremental compaction. See also -Xnopartialcompactgc. By default, this option is not set, so all compactions are full.
-Xsoftmx<size> (AIX only)
This option sets the initial maximum size of the Java heap. Use the -Xmx option to set the maximum heap size. Use the AIX DLPAR API in your application to alter the heap size limit between -Xms and -Xmx at run time. By default, this option is set to the same value as -Xmx.
-Xsoftrefthreshold<number>
Sets the value used by the GC to determine the number of GCs after which a soft reference is cleared if its referent has not been marked. The default is 32, meaning that the soft reference is cleared after 32 * (percentage of free heap space) GC cycles where its referent was not marked.
-Xtgc:<arguments>
Provides GC tracing options, where <arguments> is a comma-separated list containing one or more of the following arguments:
backtrace
Before a garbage collection, a single line is printed containing the name of the master thread for garbage collection, as well as the value of the osThread slot in the J9VMThread structure.
compaction
Prints extra information showing the relative time spent by threads in the "move" and "fixup" phases of compaction
concurrent
Prints extra information showing the activity of the concurrent mark background thread
dump
Prints a line of output for every free chunk of memory in the system, including "dark matter" (free chunks that are not on the free list for some reason, typically because they are too small). Each line contains the base address and the size in bytes of the chunk. If the chunk is followed in the heap by an object, the size and class name of the object is also printed. This argument has a similar effect to the terse argument.
freeList
Before a garbage collection, prints information about the free list and allocation statistics since the last GC. Prints the number of items on the free list, including "deferred" entries (with the scavenger, the unused space is a deferred free list entry). For TLH and non-TLH allocations, prints the total number of allocations, the average allocation size, and the total number of bytes discarded during allocation. For non-TLH allocations, also included is the average number of entries that were searched before a sufficiently large entry was found.
parallel
Produces statistics on the activity of the parallel threads during the mark and sweep phases of a global GC.
references
Prints extra information every time that a reference object is enqueued for finalization, showing the reference type, reference address, and referent address.
scavenger
Prints extra information after each scavenger collection. A histogram is produced showing the number of instances of each class, and their relative ages, present in the survivor space. The information is obtained by performing a linear walk-through of the space.
terse
Dumps the contents of the entire heap before and after a garbage collection. For each object or free chunk in the heap, a line of trace output is produced. Each line contains the base address, "a" if it is an allocated object, and "f" if it is a free chunk, the size of the chunk in bytes, and, if it is an object, its class name.
-Xverbosegclog[:<file>[,<X>,<Y>]]

Causes -verbose:gc output to be written to the specified file. If the file cannot be found, -verbose:gc tries to create the file, and then continues as normal if it is successful. If it cannot create the file (for example, if an invalid filename is passed into the command), it redirects the output to stderr.

If you specify <X> and <Y> the -verbose:gc output is redirected to X files, each containing Y GC cycles.

The dump agent tokens can be used in the filename. See the Diagnostics Guide (http://www.ibm.com/developerworks/java/jdk/diagnosis/60.html) section on the "Dump agent tokens" for more information. If you do not specify <file>, verbosegc.%Y%m%d.%H%M%S.%pid.txt is used.

By default, no verbose GC logging occurs.

Appendix B. Known limitations

Known limitations on the SDK and Runtime Environment for Windows.

Font problems in supported locales

The IBM 32-bit SDK for Windows, v6 supports the following locales:

However the fonts from these locales might not work on AWT components.

Use of sockets with IPv6

The IBM 32-bit SDK for Windows, v6 supports IPv6. However, because the current IPv6 support in Windows is not dual-stack, the SDK emulates dual-stack behavior on an IPv6 enabled system. Your Java application might use up to twice as many sockets because of the nature of the emulation. To disable this emulation, disable IPv6 support in the SDK by setting the system property java.net.preferIPv4Stack to true.

JConsole monitoring tool Local tab

In the IBM JConsole tool, the Local tab, which allows you to connect to other Virtual Machines on the same system, is not available. Also, the corresponding command line pid option is not supported. Instead, use the Remote tab in JConsole to connect to the Virtual Machine that you want to monitor. Alternatively, use the connection command-line option, specifying a host of localhost and a port number. When you start the application that you want to monitor, set these command-line options:

-Dcom.sun.management.jmxremote.port=<value>
Specifies the port the management agent listens on.
-Dcom.sun.management.jmxremote.authenticate=false
Disables authentication unless you have created a user name file.
-Dcom.sun.management.jmxremote.ssl=false
Disables SSL encryption.

Incorrect stack traces when loading new classes after an Exception is caught

If new classes are loaded after an Exception has been caught, the stack trace contained in the Exception might become incorrect. The stack trace becomes incorrect if classes in the stack trace are unloaded, and new classes are loaded into their memory segments.

Web Start and Java 1.3 applications

The IBM 32-bit SDK for Windows, v6 Web Start does not support launching Java 1.3 applications.

Input Method Editor (IME)

When working with an Input Method Editor (IME), complete the character composition and select the candidate before using the workspace for any other operation.

When a user types text in an AWT TextArea while using an Input Method Editor (IME), and then resizes the application window before committing the text, the text is committed automatically.

Slow DSA key pair generation

Creating DSA key pairs of unusual lengths can take a significant amount of time on slow machines. Do not interpret the delay as a stop or endless loop, because the process finishes if sufficient time is allowed. The DSA key generation algorithm has been optimized to generate standard key lengths (for instance, 512, 1024) more quickly than others.

Personal firewalls

Personal firewalls can cause problems for the Windows NIO code, causing particular operations to fail. For example, the method call Selector.open() can throw a "java.io.IOException: Unable to establish loopback connection" with a cause of "java.net.ConnectException: Connection refused: connect". The exception is caused by the operating system connecting on a port that is being blocked by the firewall. The JVM tries the connect operation again, asking the operating system to select a different port number. If it still cannot connect after several attempts, a ConnectException is thrown.

If you see this exception, you can set the system property java.nio.debug=pipe to see which port numbers are being blocked.

File handle exhaustion

On Windows 2000 and XP, the default value of the number of files that you can have simultaneously opened is too low and causes problems to applications that are I/O intensive. To fix this limitation, edit the file <windows>\system32\CONFIG.NT and set the following values:

files=200
buffers=60

where <windows> is the directory where Windows is installed.

DirectDraw and mouse pointer problems

On Windows 2000, with a 32-bit color depth, the DirectDraw mechanism of the JVM does not repaint the region under the mouse pointer. The effect is that gray or black squares are displayed on menus after the mouse has been there. The workaround is either to switch off direct draw (-Dsun.java2d.noddraw), or to change your screen color resolution to some other value, such as 256 color.

NIO connection problems

The NIO SocketChannel finishConnect() method can return true (the channel is connected) or false (the connection process is not yet complete), or can throw an exception. On Windows 2000, when using non-blocking connections, false might be returned even after a previous Java select() call has implied that a channel is ready for processing.

Stack range of the main thread

You cannot alter the stack range of the Java main thread (also known as the primordial thread) at run time. The main thread has a fixed size of 256 KB, determined as the optimum value for performance reasons. You can use the -Xss option to modify the stack range only on threads other than the main one. Do not use the main thread for heavily recursive calculations because the main thread is more prone to stack overflow than other threads.

DBCS characters

If you are typing DBCS characters in a JTextArea, JTextField, or JFileChooser, switching from some Chinese IMEs (in particular, Chinese Internal Code and Zhengma) to Intelligent ABC IME might cause a core dump to be produced.

Czech language installation

For Czech users, note that the language selection panel of the installation program offers one translated entry in an installation that is otherwise not translated. This limitation is caused by the installation program. The string is picked up from the operating system based on the code page. Because Polish (for which the installation is translated) and Czech both have code page 1250, the installation program attempts to retrieve a language list from the system for both languages, resulting in this string in the language list.

Traditional Chinese and the more command

If you use Traditional Chinese, do not pipe the output from your Java application directly into the more command. Instead, direct the output to a temporary file and view the file separately.

Accent corruption for Catalan users

For Catalan users of Windows 2000, use the Lucida Console font to avoid corruption of accented capital letters.

NullPointerException with the GTK Look and Feel

DBCS environments only

If your application fails with a NullPointerException using the GTK Look and Feel, unset the GNOME_DESKTOP_SESSION_ID environment variable.

Unicode Shift_JIS code page alias

Japanese users only

The Unicode code page alias "\u30b7\u30d5\u30c8\u7b26\u53f7\u5316\u8868\u73fe" for Shift_JIS has been removed. If you use this code page in your applications, replace it with Shift_JIS.

-Xshareclasses:<options>

Shared classes cache and control files are not compatible between Java 6 SR4 and previous releases.

Java Kernel installation

The Java kernel aims to reduce the startup time imposed by an application when it finds that the installed JRE needs an update. When this situation occurs, the Java kernel automatically downloads only the Java components that are needed directly from the Sun Web site. This automated download is currently not possible with the IBM implementation of this Sun Java update.

Java Deployment Toolkit

The toolkit implements the JavaScript™ DeployJava.js, which can be used to automatically generate any HTML needed to deploy applets and Java Web Start applications. However, the automatic generation is not possible with the IBM release of Java, because the process involves downloading and running the specific JRE from a public site, using public functions.

Next-Generation Java Plug-In Technology

There are some known limitations relating to Next-Generation Java Plug-In Technology:

  1. Firefox 3 does not work on Windows for Next-Gen plug-ins because code changes implemented by the Mozilla group currently support the detection of new plug-ins using only the Sun registry keys. More information about these code changes can be found at https://bugzilla.mozilla.org/show_bug.cgi?id=406040. However, Firefox 3 works on Windows for the old Java plug-ins, or classic plug-ins.
  2. When using the Next-Generation Plug-In, the IBM Java Console option previously available in the Microsoft Internet Explorer tools menu is not available.
  3. Secure Static Versioning (SSV) support is not provided for Next-Generation plug-ins.

Expired GTE Cybertrust Certificate

The IBM Runtime Environment for Java contains an expired GTE CyberTrust Certificate in the CACERTS file for compatibility reasons. The CACERTS file is provided as a default truststore. Some common public certificates are provided as a convenience.

If no applications require the certificate, it can be left in the CACERTS file. Alternatively, the certificate can be deleted. If applications do require the certificate, modify them to use the newer GTE CyberTrust Global root certificate that expires in 2018.

This certificate might be removed for later versions of the SDK.

Java Communications API (JavaComm) parallel port detection

The JavaComm API gives Java applications a platform-independent way of performing serial and parallel port communications for technologies such as voice mail, fax, and smart cards. On Microsoft Windows 7 and Microsoft Windows Server 2008 R2, the parallel port is not detected by the operating system. This means that the JavaComm API for parallel ports cannot be used on these operating systems. However, the serial port can be used for communication.

Java installation on Windows 7 on Intel 32-bit architecture

This limitation applies only to Java 6 SR6.

The first installation and uninstallation of the Java SDK is successful. However, repeat installation and uninstallation cycles might generate one or more of the following error messages during install or uninstall:

"Error 1316. A network error occurred while reading the file. F:\Users\ADMINI~1\AppData\Local\Temp\
			{DEF2FE6F-D233-45AD-94F4-3D050F1685D3}\IBM 32-bit SDK for Java v6 .msi"
msci missing
msi file missing

This problem does not apply to the Java JRE.

Using Web Start to launch a JNLP application

When using Web Start to launch a Java Network Launching Protocol (JNLP) application that requires an older version of Java, you might see an error containing the following message:

java.lang.NoClassDefFoundError: com/sun/deploy/util/BlackList

This results from a check controlled by the deployment configuration property deployment.security.blacklist.check The property is enabled using the Enable blacklist revocation check option in the Java Control Panel.

To work around the problem:

  1. Launch the Java Control Panel.
  2. Select Advanced tab -> Security.
  3. Clear the Enable blacklist revocation check option.

Using -Xshareclasses:destroy during JVM startup

When running the command java -Xshareclasses:destroy on a shared cache that is being used by a second JVM during startup, you might have the following issues:

Windows 7 requires approval to run ssvagent.exe when Next-Generation Java Plug-In is disabled

If Next-Generation Java Plug-in is disabled on Windows 7, Windows Vista or Windows Server 2008, a UAC (User Account Control) dialog requesting user consent to run ssvagent.exe might be seen when Internet Explorer is launched. This behavior is enforced by the operating system when the user is not logged on as Administrator, or does not run Internet Explorer with Administrator privileges. You can give consent to run this executable file.

Notices

This information was developed for products and services offered in the U.S.A.

IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.

IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not grant you any license to these patents. You can send license inquiries, in writing, to:

For license inquiries regarding double-byte character set (DBCS) information, contact the IBM Intellectual Property Department in your country or send inquiries, in writing, to:

The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law:

INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you.

This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice.

Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk.

IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you.

Licensees of this program who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact:

Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee.

The licensed program described in this document and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement, IBM International Program License Agreement or any equivalent agreement between us.

Any performance data contained herein was determined in a controlled environment. Therefore, the results obtained in other operating environments may vary significantly. Some measurements may have been made on development-level systems and there is no guarantee that these measurements will be the same on generally available systems. Furthermore, some measurements may have been estimated through extrapolation. Actual results may vary. Users of this document should verify the applicable data for their specific environment.

Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.

All statements regarding IBM's future direction or intent are subject to change or withdrawal without notice, and represent goals and objectives only.

COPYRIGHT LICENSE:

This information contains sample application programs in source language, which illustrate programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. The sample programs are provided "AS IS", without warranty of any kind. IBM shall not be liable for any damages arising out of your use of the sample programs.

Each copy or any portion of these sample programs or any derivative work, must include a copyright notice as follows:

© (your company name) (year). Portions of this code are derived from IBM Corp. Sample Programs. © Copyright IBM Corp. _enter the year or years_.

If you are viewing this information softcopy, the photographs and color illustrations may not appear.

Trademarks

IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (® or ™), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at http://www.ibm.com/legal/copytrade.shtml.

Intel is a trademark of Intel Corporation in the United States, other countries, or both.

Linux is a trademark of Linus Torvalds in the United States, other countries, or both.

Microsoft, Windows and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.

Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.

Other company, product, or service names may be trademarks or service marks of others.