# IBM 64-bit Runtime Environment for Linux on AMD64/EM64T architecture, Java 2 Technology Edition, Version 1.4.2

# Runtime Environment User Guide

# Copyright information

Note: Before using this information and the product it supports, be sure to read the general information under Notices.

This edition of the User Guide applies to the IBM 64-bit Runtime Environment for Linux on AMD64/EM64T architecture, Java 2 Technology Edition, Version 1.4.2.

(c) Copyright Sun Microsystems, Inc. 1997, 2003, 901 San Antonio Rd., Palo Alto, CA 94303 USA. All rights reserved.

(c) Copyright International Business Machines Corporation, 1999, 2005. All rights reserved.

U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

# Preface

This User Guide describes the IBM(R) Runtime Environment for Linux(TM) on AMD64 architecture.

The IBM Runtime Environment contains the Java(TM) Virtual Machine (JVM), core Sun Microsystems Java classes, and supporting files. The Runtime Environment does not contain all the classes that are found in the SDK package.

The User Guide provides general information about the Runtime Environment and specific information about any differences in the IBM implementation of the Runtime Environment compared with the Sun implementation. Read this User Guide in conjunction with the more extensive documentation on the Sun Web site: http://java.sun.com.

The IBM JVM Diagnostics Guide provides more detailed information about the IBM JVM.

For the list of distributions against which the SDK for Linux has been tested, see: http://www-106.ibm.com/developerworks/java/jdk/linux/tested.html

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

The terms "Runtime Environment" and "Java Virtual Machine" are used interchangeably throughout this User Guide.

Technical changes made to this User Guide for Version 1.4.2, other than minor or obvious ones such as updating "1.4.1" to "1.4.2", are indicated in red when viewing in HTML or in a color-printed copy and by vertical bars to the left of the changes.

# Contents

Copyright information
Preface
Overview
Files included with the Runtime Environment for Linux
License agreement
The Just-In-Time (JIT) compiler
The Java Native Interface and the Native Method Interface
Configuring the Runtime Environment
| |
Migrating from other IBM JVMs
Uninstalling the Runtime Environment for Linux
Uninstalling the installable Red Hat Package Manager (RPM) package
Uninstalling the compressed Tape Archive (TAR) package
Launching a Java application
Summary of commands
Options
Standard options
Nonstandard options
Globalization of the java command
Working with classpaths
Specifying garbage collection policy
Pause time
Pause time reduction
Environments with very full heaps
How the JVM processes signals
Signals used by the JVM
Linking a native code driver to the signal-chaining library
Implementing the Connection Handler Pool for RMI
Obtaining the IBM build and version number
Working with floating stacks
Switching the input method in DBCS languages
Installing your application on a user's system
Known limitations
Any comments on this User Guide?
Notices
Trademarks

# Overview

The Runtime Environment contains the Java Virtual Machine, Java classes, and supporting files. The Runtime Environment contains only a subset of the classes that are found in the SDK and allows you to run Java classes but does not allow you to compile Java programs.

## Files included with the Runtime Environment for Linux

The Runtime Environment for Linux includes binary object files and class files that are needed to support a program at runtime. The Runtime Environment for Linux does not include any of the development tools, such as appletviewer or the Java compiler (javac), or classes that would pertain only to a development system.

In addition, the Java Communications application programming interface (API) package is provided for use with the Runtime Environment for Linux. If you have installed the Java Communications API, you can find information about it in the JavaComm API User Guide.

## License agreement

The LICENSE_xx.html file contains the license agreement for the Runtime Environment for Linux software. (xx is an abbreviation for the language.)

To view or print the license agreement, open the file in a Web browser.

## The Just-In-Time (JIT) compiler

The Just-In-Time (JIT) compiler (libj9jit22.so) dynamically generates machine code for frequently used bytecode sequences in Java applications and applets while they are running.

The Runtime Environment for Linux includes the JIT, which is enabled by default. You can disable the JIT to help isolate a problem with a Java application, an applet, or the compiler itself.

To disable the JIT, use the -Xint option. At the shell prompt window where you run the application, type:

        java -Xint class

To verify whether or not the JIT is enabled, type at a shell prompt:

        java -version

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

    (JIT enabled)

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

    (JIT disabled)

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

## The Java Native Interface and the Native Method Interface

The Java Native Interface (JNI) is included with the Runtime Environment. For information about using the JNI, see the Sun Web site: http://java.sun.com/j2se/1.4.2/docs/guide/jni.

IBM does not support the Native Method Interface in this release. Do not use this interface in your applications.

# Configuring the Runtime Environment

After you install the Runtime Environment, edit your shell login script and add this directory to your PATH statement:

/opt/IBMJava2-amd64-142/jre/bin

If you installed the Runtime Environment in a directory other than /opt/IBMJava2-amd64-142/, replace /opt/IBMJava2-amd64-142/ with the directory in which you installed the Runtime Environment.

| | |

# Migrating from other IBM JVMs

|

The IBM 64-bit Runtime Environment for Linux on AMD64/EM64T architecture, Java 2 Technology Edition, Version 1.4.2 contains new versions of the IBM Java Virtual Machine and |the Just-In-Time (JIT) compiler. If you are migrating from an IBM Runtime |Environment on another platform, you might need to be aware of the following |differences:

|

|
- The JVM shared library libjvm.so is installed in directory jre/bin/j9vm. This is different, for |example, from the IBM 32-bit Runtime Environment for Linux, Java 2 Technology |Edition, Version 1.4.2, where it is installed in jre/bin/classic. Native applications using the JNI |invocation interface might need to add the new directory path to their environment |variable or variables in order to locate the JVM dynamic link library.

# Uninstalling the Runtime Environment for Linux

The process that you use to remove the Runtime Environment for Linux depends on whether you installed the installable Red Hat Package Manager (RPM) package or the compressed Tape Archive (TAR) package. See Uninstalling the installable Red Hat Package Manager (RPM) package or Uninstalling the compressed Tape Archive (TAR) package for instructions.

## Uninstalling the installable Red Hat Package Manager (RPM) package

To uninstall the Runtime Environment for Linux if you installed the installable RPM package:

1. At a shell script, type:

   -         rpm -e IBMJava2-JRE-1.4.2-0.0

   Alternatively, you can use a graphical tool such as kpackage or yast2
2. Remove from your PATH statement the directory in which you installed the Runtime Environment .

## Uninstalling the compressed Tape Archive (TAR) package

To uninstall the Runtime Environment for Linux if you installed the compressed TAR package:

1. Remove the Runtime Environment files from the directory in which you installed the Runtime Environment.
2. Remove from your PATH statement the directory in which you installed the Runtime Environment.

# Launching a Java application

The java tool launches a Java application. It requires an initial Java class name as parameter. If you do not supply this, a usage message is printed.

The JVM searches for the initial class, and other classes that are used, in three sets of locations: the bootstrap classpath, the installed extensions, and the user classpath. Arguments after the class name or JAR file name are passed to the main function.

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 appear. The javaw launcher displays a dialog box with error information if a launch fails.

## Summary of commands

The java and javaw command have the following syntax:

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

Items that are within brackets are optional.

options
  Command-line options.
class
  Name of the class to invoke.
file.jar
  Name of the jar file to invoke. It is used only with -jar.
argument
  Argument passed to the main function.

If the -jar option is specified, the named JAR file contains class and resource files for the application, with the startup class indicated by the Main-Class manifest header.

## Options

The launcher has a set of standard options that are supported on the current runtime environment and will be supported in future releases. In addition, there is a set of nonstandard options.

### Standard options

- -D<property_name>=<value>
  - Sets a system property.
- -assert
  - Prints help on assert-related options.
- -cp or -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 CLASSPATH is not set, the user classpath is, by default, the current directory (.). Also see Working with classpaths.
- -help or -?
  - Prints a usage message.
- -showversion
  - Prints product version and continues.
- -verbose:[class |gcterse |gc |dynload |stackwalk |sizes |stack |debug |jni]
  - Enables verbose output.
- -version
  - Prints product version.
- -X
  - Prints help on nonstandard options.

### Nonstandard options

The -X options listed below are nonstandard and subject to change without notice.

- -Xargencoding
  - Allows you to put Unicode escape sequences in the argument list.
- -Xbootclasspath:<directories and zip or jar files separated by ;>
  - Sets the search path for bootstrap classes and resources.
- -Xbootclasspath/a:<directories and zip or jar files separated by ;>
  - Appends the specified directories, zip, or jar files to the end of bootstrap class path.
- -Xbootclasspath/p:<directories and zip or jar files separated by ;>
  - Prepends the specified directories, zip, or jar files to the front of the bootstrap class path. Do not deploy applications that use the -Xbootclasspath: or -Xbootclasspath/p: option to override a class in core.jar, graphics.jar, server.jar, security.jar, xml.jar, tools.jar, or charsets.jar, because such a deployment would contravene the Java 2 Runtime Environment binary code license.
- -Xcheck:jni
  - Performs additional checks for JNI functions. You can also use -Xrunjnichk.
- -Xcheck:nabounds
  - Performs additional checks for JNI array operations. You can also use -Xrunjnichk.
- -Xcompactexplicitgc
  - Compact on every call to `System.gc()`. See also -Xnocompactexplicitgc
- -Xcompactgc
  - Compact every Garbage Collector cycle. See also -Xnocompactgc
- -Xdbg:<options>
  - Loads debugging libraries to support the remote debugging of applications. This is the same as -Xrunjdwp
- -Xdbginfo:<path to symbol file>
  - Loads and passes options to the debug information server.
- -Xdisablejavadump
  - Causes system dumps to be generated instead of javadumps when errors occur.
- -Xdebug
  - Starts the JVM with the debugger enabled.
- -Xdisableexplicitgc
  - Changes calls to `System.gc()` into no-ops.
- -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 of the Java application launcher.
- -Xgc:<options>
  - Passes options such as verbose, compact, nocompact, and so on, to the Garbage Collector.
- -Xgcpolicy:[:optthruput]|[:optavgpause]|[:gencon]
  - Controls the behavior of the garbage collector. The optthruput option is the default and delivers very high throughput to applications, but at the cost of occasional pauses. 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 very large heap.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.
- -Xgcthreads<number of threads>
  - Sets the number of threads that must perform garbage collection.
- -Xint
  - Makes the JVM use the Interpreter only, disabling the JIT and AOT.
- -Xiss
  - Sets the initial Java thread stack size.
- -Xjit[:<number of threads>]
  - Enables the JIT or passes options to it, or both. See also -Xnojit.
- -Xlinenumbers
  - Enables the line numbers for debugging. See also -Xnolinenumbers.
- -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 10MB.
- -Xmaxf<size>
  - Specifies the maximum percentage of heap that must be free after a garbage collection. If the free space exceeds this amount, the JVM attempts to shrink the heap. Specify the size as a decimal value in the range 0-1, for example `-Xmaxf0.5` sets the maximum free space to 50%. The default value is 0.6.
- -Xmca<size>
  - Sets RAM class segment to increment by the specified size.
- -Xmco<size>
  - Sets ROM class segment to increment by the specified size.
- -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 by 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 50MB.
- -Xminf<size>
  - Specifies the minimum percentage of heap that should be free after a garbage collection. If the free space falls below this amount, the JVM attempts to expand the heap. Specify the size as a decimal value in the range 0-1; for example, a value of `-Xminf0.3` requests the minimum free space to be 30% of the heap
- -Xmn<size>
  - Sets the size of the new heap to the specified size.
- -Xmo<size>
  - Sets the initial Java heap size. You can also use -Xms.
- -Xmoi<size>
  - Increments the initial Java heap size.
- -Xmr<size>
  - Sets the remembered set size.
- -Xms<size>
  - Sets the initial Java heap size. You can also use -Xmo.
- -Xmso<size>
  - Sets the size of the OS thread stack.
- -Xmx<size>
  - Sets maximum Java heap size.
- -Xnm
  - Specifies the size of the monitor pool.
- -Xnoagent
  - Disables the old sun.tools.debug interface, so that you can use the JPDA debug support.
- -Xnoaot
  - Disables the AOT.
- -Xnoclassgc
  - Disables class garbage collection. This switches off garbage collection of storage associated with Java classes that are no longer being used by the JVM.
- -Xnocompactgc
  - Disables compaction for the Garbage Collector. See also -Xcompactgc
- -Xnocompactexplicitgc
  - Disables compact on a call to `System.gc()`. See also -Xcompactexplicitgc
- -Xnojit
  - Disables the JIT. See also -Xjit.
- -Xnolinenumbers
  - Disables the line numbers for debugging. See also -Xlinenumbers.
- -Xnopartialcompactgc
  - Disables incremental compaction on a call to `System.gc()`. See also -Xpartialcompactgc
- -Xnosigcatch
  - Disables JVM recovery code. See also -Xsigcatch.
- -Xnosigchain
  - Disables the chaining of signal handlers. See also -Xsigchain.
- -Xoptionsfile=<file>
  - Specifies a file that contains JVM options and defines.
- -Xoss<size>
  - Sets maximum Java stack size for any thread.
- -Xpartialcompactgc
  - Enables incremental compaction on every call to `System.gc()`. See also -Xnopartialcompactgc
- -Xquickstart
  - Improves startup time by delaying compilation.
- -Xrdbginfo:<host>:<port>
  - Loads and passes options to the remote debug information server.
- -Xrs
  - Reduces the use of operating system signals.
- -Xrunlibrary_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 is the same as -Xdbg
    - -Xrunjnichk[ :verbose | trace | profile | nonfatal | nowarn | noadvice | pedantic | help]
      - Performs additional checks for JNI functions.
- -Xsigcatch
  - Enables JVM recovery code. See also -Xnosigcatch.
- -Xsigchain
  - Enables the chaining of signal handlers. See also -Xnosigchain.
- -XsigquitToFile<path to file><filename>
  - Dumps the information from the sigquit trace to the specified file.
- -Xss<size>
  - Sets maximum native stack size for any thread. For more information, see Working with floating stacks.
- -Xthr:<options>
  - Sets the threading options.
- -Xverbosegclog:<path to file><filename>[X, Y]
  - Causes verboseGC output to be written to the specified file. If the file exists, it is overwritten. Otherwise, if an existing file cannot be opened or a new file cannot be created, the output is redirected to stderr. If you specify the arguments X and Y (both are integers) the verboseGC output is redirected to X number of files, each containing Y number of gc cycles worth of verboseGC output. These files have the form filename1, filename2, and so on.
- -Xverify
  - Enables strict class checking for every class that is loaded.
- -Xverify:none
  - Disables strict class checking.

## Globalization of the java command

The java command and other java launcher commands (such as javaw) allow a class name to be specified as any Unicode 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, you must specify -Xargencoding. To specify a Unicode character, use escape sequences in the form `\u####`, where # is a hexadecimal digit (0 through 9, A through F).

Alternatively, to specify that the class name and command arguments are in UTF8 encoding, use -Xargencoding:utf8, or in ISO8859_1 encoding use-Xargencoding:latin.

The java and javaw commands give translated output 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 are in English.

## Working with classpaths

You can specify a class name as a complete file name including a full path and the .class extension. In previous versions, you could specify only the class that was relative to the CLASSPATH, and the .class extension was not allowed. Use of the complete file name permits you to launch a java application from your desktop or file launcher. If you specify a .class file with path and extension, the specified path is put into the CLASSPATH. For example, the command `java ~/myapp/thisapp.class` is equivalent to specifying `java -classpath ~/myapp thisapp`.

## Specifying garbage collection policy

The -Xgcpolicy JVM runtime option specifies garbage collection policy.

-Xgcpolicy takes the values optthruput (the default), optavgpause, or gencon. The option controls garbage collector behavior, making tradeoffs 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

> -Xgcpolicy:optavgpause

> -Xgcpolicy:gencon

### 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, 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
- 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 the GC concentrates on just those objects that are most likely to be recyclable, you can further reduce pause times for some applications. Generational GC achieves this by dividing the heap into two "generations", the "nursery" and the "tenure" areas. Objects are placed in one of these areas depending on their age. The nursery is the smaller of the two and contains younger objects; the tenure is larger and contains older objects. Objects are first allocated to the nursery; if they survive long enough they are promoted to the tenure area eventually.

Generational GC depends on most objects not lasting long. Generational GC reduces pause times by concentrating the effort to reclaim storage on the nursery because it has the most recyclable space. Rather than occasional but lengthy pause times to collect the entire heap, the nursery is collected more frequently and, if the nursery is small enough, pause times are comparatively short. However, generational GC has the drawback that, over time, the tenure area might become full if too many objects last too long. 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 is to 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 of the above options is used; and, if requests for more heap space continue to be made, the application receives an OutofMemory exception, which results in JVM termination if the exception is not caught and handled. At this point the JVM will produce a "javadump" diagnostic file. In these conditions, you are recommended either to increase the heap size by using the -Xmx option, or to reduce the number of application objects in use.

# 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, after the JVM has finished processing, the application handler for this signal is called.

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.

For exception and error signals, the JVM either:

- Handles the condition and recovers, or
- Enters a controlled shutdown sequence where it:
  1. Outputs a Javadump, to describe the JVM state at the point of failure
  2. Calls your application's signal handler for that signal
  3. Calls any application-installed abort hook
  4. Performs the necessary cleanup to give a clean shutdown

For information about writing a launcher that specifies the above hooks, see: http://www-106.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 shutdown sequence, but this time it is treated as a normal termination that:

- Calls your application's signal handler for that signal
- Runs all application shutdown hooks
- Calls any application-installed exit hook
- Performs the necessary JVM cleanup

The shutdown is identical to the shutdown 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 terminate. The only control signal of interest is SIGQUIT, which causes a Javadump to be generated.

## Signals used by the JVM

Table 1 below 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 a fatal 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 shutdown.
- Controls: Other signals that are used by the JVM for control purposes.

Table 1. Signals used by the JVM
Signal Name | Signal type | Description | Disabled by -Xrs
--- | --- | --- | ---
SIGBUS | Exception | Incorrect access to memory (data misalignment) | No
SIGSEGV | Exception | Incorrect access to memory (write to inaccessible memory) | No
SIGILL | Exception | Illegal instruction (attempt to invoke an unknown machine instruction) | No
SIGFPE | Exception | Floating point exception (divide by zero) | No
SIGABRT | Error | Abnormal termination. The JVM raises this signal whenever it detects a JVM fault. | No
SIGINT | Interrupt | Interactive attention (CTRL-C). JVM exits normally. | Yes
SIGTERM | Interrupt | Termination request. JVM will exit normally. | Yes
SIGHUP | Interrupt | Hang up. JVM exits normally. | Yes
SIGQUIT | Control | A quit signal for a terminal. JVM uses this for taking Javadumps. | No
SIGPIPE | Control | Broken pipe. Set to SIG_IGN | No

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 at http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html.

Signals `1 (SIGHUP)`, `2 (SIGINT)`, `4 (SIGILL)`, `7 (SIGBUS)`, `8 (SIGFPE)`, `11 (SIGSEGV)`, and `15 (SIGTERM)` on JVM threads cause the JVM to shut down; therefore, an application signal handler should not attempt to recover from these unless it no longer requires the services of 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.

Signal-chaining enables an application to link and load the shared library libjsig.so before the system libraries. The libjsig.so library ensures that calls such as `signal()`, `sigset()`, and `sigaction()` 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 invoked.

To use libjsig.so:

- Link it with the application that creates or embeds a JVM:

      gcc -L$JAVA_HOME/bin -ljsig -L$JAVA_HOME/bin/j9vm -ljvm java_application.c

  or
- Use the LD_PRELOAD environment variable:

      export LD_PRELOAD=$JAVA_HOME/bin/libjsig.so; java_application (bash and ksh)

      setenv LD_PRELOAD=$JAVA_HOME/bin/libjsig.so; java_application (csh)

  (Assuming that `JAVA_HOME` is set up; otherwise, use /opt/IBMJava2-amd64-142/jre.)

If you install signal handlers that use `sigaction()` , some sa_flags are not observed when the JVM uses the signal. These are:

- SA_NOCLDSTOP - This is always unset.
- SA_NOCLDWAIT - This is always unset.
- SA_RESTART - This is always set.

The libjsig.so 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.

# Implementing the Connection Handler Pool for RMI

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

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

    -Dsun.rmi.transport.tcp.connectionPool=true (or any non-null value)

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

For more information, see the Sun Java site: http://java.sun.com.

# Obtaining the IBM build and version number

To obtain the IBM build and version number, at a shell prompt type:

    java -version

# Working with floating stacks

On a nonfloating stack Linux system, regardless of what is set for -Xss, a minimum native stack size of 256 KB for each thread is provided. On a floating stack Linux system, the -Xss values are honored. Therefore, if you are migrating from a non-floating stack Linux system, you must ensure that any -Xss values are large enough and are not relying on a minimum of 256 KB.

# Switching the input method in DBCS languages

On double-byte character set (DBCS) systems, if you want to switch the input method, you should use java.util.prefs.Preferences class instead of IBMJAVA_INPUTMETHOD_SWITCHKEY and IBMJAVA_INPUTMETHOD_SWITCHKEY_MODIFIERS environment variables. See Sun's Input Method Framework Specification in detail.

# Installing your application on a user's system

After you develop your product and are ready to ship, you need to install your product on a user's system, configure the user's system to support your software, and configure the runtime environment.

If you use the Runtime Environment for Linux, you must make sure that your installation procedure does not overwrite an existing installation (unless the existing Runtime Environment for Linux is an older version).

To redistribute the Runtime Environment for Linux, you can install it on your own system, then copy the required Runtime Environment files into your installation set. If you choose this approach, you must include all the files provided with the Runtime Environment for Linux. The Runtime Environment for Linux software can be redistributed only if all files are included. In effect, when you ship your application, it has its own copy of the Runtime Environment for Linux.

For specific information about the files that must be redistributed, see the license agreement that accompanies this product.

# Known limitations

The following known limitations apply to the Runtime Environment for Linux.

- |Important note about BIOS settings on |AMD64 SMP systems: |

  The Node memory interleaving BIOS |setting must be set to `DISABLED`. Otherwise, unpredictable results |might occur, including Java crashes and hangs. This instruction is in accord |with AMD's recommendation.

- You might not be able to use the system clipboard with double-byte character set (DBCS) to copy information between Linux applications and Java applications if you are running the K Desktop Environment (KDE).
- The SDK implements Java threads as native threads, which results in each thread being a separate Linux process. If the number of Java threads exceeds the maximum number of processes allowed, your program might get an error message, a SIGSEGV error, or your system might hang.

  The maximum number of threads available is determined by the minimum of:

  - The user processes setting (ulimit -u) in /etc/security/limits.conf
  - The limit that is defined in /proc/sys/kernel/threads_max
  - The limit PTHREAD_THREADS_MAX that is defined in libpthreads.so (change requires glibc to be recompiled)

  However, you might run out of virtual storage before you reach the maximum number of threads.

- If you terminated a Java application with a Ctrl-C, several processes might be left orphaned.
- An attempt to display dialog boxes that are created with Swing might cause a delay of a few seconds before those boxes are displayed in the window.
- KeyEvent results that include the ALT key differ between using different window managers in Linux. They also differ from results of other operating systems. In the Enlightenment window manager, Alt+A and Shift+Alt+A produce different modifiers, and Ctrl+Alt+A produces no key event at all. However, using the WindowMaker window manager, Ctrl+Alt+A produces a key event.
- On the Linux X Window System, the keymap is set to: 64 0xffe9 (Alt_L) 0xffe7 (Meta_L), and 113 0xffea (Alt_R) 0xffe8 (Meta_R). You can check this by typing the following at a shell prompt:

      xmodmap -pk

  This is why the SDK considers that Meta + Alt are being pressed together. As a workaround, you can remove the Meta_x mapping by typing the following at a shell prompt:

      xmodmap -e "keysym Alt_L = Alt_L" -e "keysym Alt_R = Alt_R"

  Note:
  This workaround might affect other X-Window applications that are running on the same display if they use the Meta-key that was removed.
- Creating DSA key pairs of unusual lengths can take a significant amount of time on slow machines. Do not interpret this delay as a hang because the process will complete if you allow enough time. The DSA key generation algorithm has been optimized to generate standard key lengths (for instance, 512, 1024) more quickly than others.
- A call to JNI_CreateJavaVM() from a JNI application might cause a segmentation fault (signal SIGSEGV); to avoid this fault, rebuild your JNI program specifying the option -lpthread.
- For users of Traditional Chinese only, function keys Enter, Space, Backspace, and ESC do not work as expected when using the LinYi ZhuYin, YiTian ZhuYin, and Bosham IMEs to input the TCH characters. The Enter key inserts a new line, the ESC key is used to cancel the preedit strings or the candidate window, and the Space bar inserts a space. The candidate window should disappear after the commit key has been pressed and it should not appear when you press the Backspace key while using the LinYi ZhuYin, YiTian ZhuYin, and Bosham IMEs to input the Traditional Chinese characters.
- If you are running with a lot of concurrent threads, you might get a warning message: `java.lang.OutOfMemoryError`. This is an indication that your machine is running out of system resources and messages can be caused by the following reasons:
  1. New threads cannot be created because:
     - The number of processes created exceeds your user limit.
     - Not enough system resources are available to create new threads. In this case, you might see also other Java exceptions, depending on what your application is running.
  2. Kernel memory is either running out or is fragmented. You can see corresponding Out of Memory kernel messages in /var/log/messages that have the killed process id.
  Try tuning your system to increase the corresponding system resources.
- During installation, if you have already installed an earlier version of this product that was distributed by Red Hat, the Red Hat Package Manager (RPM) will report that the IBM package is older than any versions of the product that Red Hat has distributed. This condition occurs because Red Hat adds to the RPM package a "serial number" that overrides the versioning scheme of the product in the package, and, by default, the RPM refuses to install a package that seems to be older than one already installed. The --oldpackage option of the rpm command enables you to install the new IBM package.
- When running a java awt/swing application on a Linux machine and exporting the display to a second machine, you might experience problems displaying some dialogs if the set of fonts loaded on the X client machine is different from the set loaded on the X server machine. This problem is noticeable particularly with SLES8 in Chinese locales, where the default installation of the server version installs arphic fonts, but the default installation of the client does not. To avoid this problem, install the same fonts on both machines.
- If your system locale is using a UTF-8 encoding, some SDK tools might throw a sun.io.MalformedInputException. To find out whether your system is using a UTF-8 encoding, examine the locale-specific environment variables such as LANG or LC_ALL to see if they end with the suffix ".UTF-8". If you get this sun.io.MalformedInputException, change characters that are not within the 7-bit ASCII range (0x00 - 0x7f) and are not represented as Java Unicode character literals to Java Unicode character literals (for example: '\u0080'). You can also work around this problem by removing the ".UTF-8" suffix from the locale-specific environment variables; for example, if your machine has default locale of "en_US.UTF-8", set LANG to "en_US".
- If you are using AMI and xcin in a cross-platform environment (for example, if you try to export the display between a 32-bit and a 64-bit system, or between a big-endian and a little-endian system) there might be some problems. If you have this kind of problem, contact your Linux distributor.
- On Redhat Enterprise Linux 3.0, Chinese characters might not be displayed in AWT text components except for GB2312 characters in the Chinese GB18030 locale.

# Any comments on this User Guide?

If you have any comments about the usefulness, or otherwise, of this User Guide, we would be pleased to hear from you through one of these channels. Please note that these channels are not set up to answer technical queries, but are for comments about the documentation only. Send your comments:

- By e-mail to idrcf@hursley.ibm.com.
- By fax:
  - From the UK: 01962 842327
  - From elsewhere:<international code>44 1962 842327
- By mail to:
  IBM United Kingdom Ltd
  User Technologies,
  Mail Point 095
  Hursley Park
  Winchester
  Hampshire
  SO21 2JN United Kingdom

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.

# 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 in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to:

- IBM Director of Licensing
  IBM Corporation
  North Castle Drive, Armonk
  NY 10504-1758 U.S.A.

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

- IBM World Trade Asia Corporation Licensing
  2-31 Roppongi 3-chome, Minato-ku
  Tokyo 106-0032, Japan

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 information. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this information 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:

- JIMMAIL@uk.ibm.com
  [Hursley Java Technology Center (JTC) 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 measurement 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.

## Trademarks

IBM is a trademark of International Business Machines Corporation in the United States, or 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.

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

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

This product includes software developed by the Apache Software Foundation http://www.apache.org/.