### Runtime Environment for the

#### IBM(R) OS/2(R) Warp Developer Kit, Java(TM) Technology Edition, Version 1.1.8

The IBM OS/2 Warp Developer Kit, Java(TM) Technology Edition, 1.1.8 (Developer Kit) is based on is based on Sun Microsystems' Java 1.1.8 maintenance level. This file describes the use of the Runtime component of the Developer Kit.

- Installation
- Java Interpreter
- Applet Viewer
- Configuration
- Platform Specifics
- Disabling the JIT Compiler
- Information for DBCS Environments
- Where to Find More Information
- Notices

  ## Installation

  See the Developer Kit README file in the \JAVA11 directory for the latest information regarding installation. After you install the product, the README file is located in the directory where you unpacked the Developer Kit files.

  The installation of the Runtime component makes the following changes to the PATH and LIBPATH statements in the CONFIG.SYS file:

        PATH        includes x:\java11\bin;
        LIBPATH     includes x:\java11\dll;

  where x is the drive where the Java Runtime component is installed.

  ## Java Interpreter

  The Java Interpreter (JAVA) executes Java byte codes. Java byte code resides in a file with an extension of .class.

  To run the Java application hello.class, at a command prompt type:

              java  hello

  Note: The file name is case-sensitive and the extension for the file should not be specified (but it must be a .class file).

  Java applications that use the Abstract Window Toolkit (AWT) can be started with the JAVA command. The JAVAPM command is provided for compatibility with prior versions of the Developer Kit but is no longer needed.

  The .class file is created by the Java Compiler (JAVAC). The Java Compiler is included as part of the Java Toolkit component and is necessary only if you will be writing Java programs.

  If you type JAVA without any options at a command prompt, a list of available options is displayed.

  ## Applet Viewer

  The Java Applet Viewer (APPLET) provides a quick way to run Java applets. If the HTML file specified does not contain a Java applet, no function is performed.

  To run the applet contained in the file tictactoe.html, at a command prompt type:

             applet  tictactoe.html

  If you type APPLET without any options at an OS/2 command prompt, a list of available options is displayed in a popup window.

  ## Configuration

  A number of environment variables are available to modify the behavior of the Java Runtime component:

  SET JAVA_AUDIO_RATE=n
    Sets the preferred playback sample rate for audio. A value of 8 for n sets the playback rate to 8000 samples per second. Use a value of 11 for 11025 samples per second. The Java runtime normally tries a sample rate of 8000, which matches the incoming data stream rate, and then 11025.

    Some drivers, such as some ThinkPad 701C drivers dated prior to October 1995, appear to support a sample rate of 8000 but then fail. This can be fixed by setting a playback sample rate of 11025.

  SET JAVA_AUDIO_VOLUME=v
    Adjusts the volume level for the audio output. v is the percentage of the maximum volume, from 0 to 100. The default is 75.

  SET JAVA_SOUND_MODE=ON
    There are two ways methods for producing sound, Memory Playlist and Direct Audio Real Time (DART). DART is the default and results in better CPU utilization and response time. Memory Playlist is the older method of producing sound and supports backwards compatibility for older, slower performing audio.

    You can use either of these two methods for running Java 1.1.x or earlier audio programs. However, if you do not need to support older, slower audio, there is no need to change the DART default. Information on using Memory Playlist or DART is provided below.

    To use the Memory Playlist method, type the following command at a command line or place it in the CONFIG.SYS file:

        SET JAVA_SOUND_MODE=ON

    To turn off the environment variable and use the DART method, type the following command at a command line or place it in CONFIG.SYS file:

        SET JAVA_SOUND_MODE=

  SET JAVA_COMPILER=<xyz>
    Specifies the name of the just-in-time (JIT) compiler to load. The default JIT is JAVAX.

    To disable the JIT, see Disabling the JIT Compiler.

  SET JAVA_CONSOLE=<1>
    Specifies that Java programs started by JAVA and APPLET are run with a Java console.

  SET JAVA_HOME=<dir>
    Specifies the path to the shared Java runtime directories.

  SET JAVA_NLS_SBCS=1
    Specifies that Java applications should run in single-byte character set (SBCS) mode even in double-byte character set (DBCS) environments.

  SET JAVA_NOPRINTDLG=1
    Specifies that Java applications should suppress display of the printer properties dialog box before printing. This allows jobs to print, without user intervention, using the default printer properties.

  SET JAVA_USER=<dir>
    Specifies the path to the directory for user-specific files such as the hotjava\property file.

  SET JAVA_WEBLOGS=<dir>
    Specifies the path to the directory where weblog files for each started Java process are written.

  SET JAVA_NORESTART=1
    Specifies that the JAVA command should not restart itself as a Presentation Manager process.

  SET JAVA_CLOCK_RESOLUTION
    Allows you to specify the timer resolution you require from the currentTimeMillis method in the java.lang.System class. The resolution is specified in milliseconds. For example:

        SET JAVA_CLOCK_RESOLUTION = 1

    sets the minimum timer resolution to 1 millisecond (the highest resolution) for Java applications that use currentTimeMillis.

    The timer resolutions available are dependent on those provided by the OS/2 operating system. The Java system rounds down to the nearest available resolution. The highest resolution, 1 millisecond, is always available. The default for JAVA_CLOCK_RESOLUTION is 10 milliseconds, and this is generally rounded to 1 millisecond accuracy.

    If you want to make available the best Java performance when using currentTimeMillis, then use:

        set JAVA_CLOCK_RESOLUTION = 32

    This can be important when running Java benchmarks.

  ## Platform Specifics

  There are a number of platform-specific changes for OS/2:

  ### General

  - The HOME environment variable is called JAVA_USER.

  ### Applet Viewer

  - The Applet Viewer program is called APPLET.

  - stdin, stdout, and stderr are directed to the OS/2 window where the Applet Viewer was started.

  - When the Applet Viewer is started directly as a Presentation Manager program (as in the following command) the stdout output and the stderr output are redirected to the WEBLOGS directory. This can be done using the following command:

             start /PM applet.exe example1.html

    To stop this redirection, specify the -nore option to stop this redirection.

  ### Java Applications

  - A Java application using the Abstract Window Toolkit (AWT) that is started by the JAVA command causes the application to restart as a Presentation Manager process. When this restart occurs, stdin, stdout, and stderr are redirected to the OS/2 window where the JAVA command was issued.

  - To prevent the JAVA command from restarting itself as a Presentation Manager process, specify the -norestart option. The JAVA_NORESTART environment variable can also be used to prevent this restart. If a Java program that uses AWT is started with java -norestart in a non-Presentation Manager session, it is unable to create any windows because of an OS/2 Presentation Manager (PM) restriction.

  - To view stdout and stderr output for Java programs executed as OS/2 PM processes, using either JAVA or APPLET, a Java console is provided. To execute under the Java console, either specify the -cons option or set the JAVA_CONSOLE environment variable.

  - If you start a Java application that calls a non-Presentation Manager program, use the -norestart option. For example, if the Java application JavaApp calls a non-Presentation Manager program, start it by typing the following at the OS/2 command prompt:

        java -norestart JavaApp

    Errors occur if you do not use the -norestart option.

  ## Disabling the JIT Compiler

  A just-in-time (JIT) compiler is provided with the Developer Kit. The JIT compiler generates machine code for frequently used byte code sequences in a Java application or applet during execution. The JIT is enabled by default.

  You can disable the JIT to aid in the isolation of a problem with a Java application, an applet, or the compiler itself by passing the following command to the Java runtime interpreter:

       -nojit

  The virtual machine directly interprets bytecodes, without converting them to native code.

  ## Information for DBCS Environments

  - Single-byte-width fonts in double-byte character set (DBCS) language font sets, such as half-width-Katakana fonts in Japanese font sets, cannot be drawn on AWT components.

    As per the JavaSoft specification, the Developer Kit supports only English font sets. To draw in a DBCS language on AWT components, the Developer Kit uses the DBCS font association function. Because of a restriction in the DBCS font association function, the Developer Kit cannot draw single-byte-width fonts in DBCS languages on AWT components.

  - Class names should not contain DBCS characters.

  - Applets cannot obtain (using the getParameter() method) DBCS string values set for parameter tags when running under the Applet Viewer, APPLET.

  ## Where to Find More Information

  For up-to-date information about Java and IBM, visit the IBM Java Home Page or Sun's Java Web site.

  ## Notices

  Trademarks

  The following are trademarks of International Business Machines Corporation in the United States, or other countries, or both:

  - IBM
  - OS/2

  The following are trademarks of other companies:

  - Java is a trademark of Sun Microsystems, Inc.
  - The Java(TM) technology is owned and exclusively licensed by Sun Microsystems, Inc. Java is a trademark of Sun Microsystems, Inc. in the U.S. and other countries.

  Copyrights

  - (c) Copyright Sun Microsystems, Inc. 1992-1998. All rights reserved.
  - (c) Copyright IBM Corporation, 1996-1998. All rights reserved.
  - This product is based in part on the work of the Independent JPEG Group.
  - US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.