Oracle8i Java Developer's Guide Release 3 (8.1.7) Part Number A83728-01 |
Library | Service | Contents | Index

## Enabling the Java Client

In order to run Java between the client and server, your client system must perform the following:

1. Install JDK on the Client.

2. Set up CLASSPATH.

3. Verify the Port/SID.

4. Test Install with Samples.

### 1. Install JDK on the Client

The client system is defined as the system where you execute the JServer tools, such as `loadjava`, `deployejb`. You can use the same system for both your client and server.

The client system requires JDK 1.1.6 or later. Solaris 2.6 bundles JDK 1.1.3, which does not work with our samples. Verify that your PATH includes JDK 1.1.6 or later and does not include JDK 1.1.3. To confirm what version of the JDK you are using, perform the following:

    $ which java
    /usr/local/packages/jdk1.1.6/bin/java
    $ which javac
    /usr/local/packages/jdk1.1.6/bin/javac
    $ java -version
    java version "1.1.6"

If JDK 1.1.6 does not appear within these commands, either put your JDK 1.1.6 installation at the start of PATH or remove the 1.1.3 installation. In addition, check your CLASSPATH for references to the incorrect JDK version.

Note: All Oracle8i Java-based client tools work in the Java 2 environment.

### 2. Set up CLASSPATH

If your client is a Java client involved with a distributed application--CORBA, EJB, or RMI--you must perform one of the following before compiling your client code:

- Set up CLASSPATH to include support JAR or ZIP files.

- Include support JAR or ZIP files within an option on the compile line.

For the Java client to work across nodes in a distributed application, it must be compiled with appropriate server stubs. The required JAR or ZIP files that must be included in the client's CLASSPATH are as follows:

Note: For NT users, the environment variables would be %ORACLE_HOME% and %JAVA_HOME%.

#### Basic Included JAR files:

    $ORACLE_HOME/lib/aurora_client.jar
    $ORACLE_HOME/lib/mts.jar
    $ORACLE_HOME/lib/vbjorb.jar
    $ORACLE_HOME/lib/vbjapp.jar

For execution, include `$ORACLE_HOME/lib/aurora.zip` on the CLASSPATH.

#### JAR Files Necessary for JDK 1.1 Clients

In order for a JDK 1.1 client to communicate with the Java 2 server, you must include the following JVM JAR file:

    $JAVA_HOME/lib/classes.zip

For any interaction with JDBC, include the following ZIP file:

    $ORACLE_HOME/jdbc/lib/classes111.zip

For any client that uses SSL, include the following JAR files:

    $ORACLE_HOME/jlib/jssl-1_1.jar
    $ORACLE_HOME/jlib/javax-ssl-1_1.jar

#### JAR Files Necessary for Java 2 Clients

In order for a Java 2 client to communicate with the Java 2 server, you must make sure that one of the following JVM JAR files are in the CLASSPATH:

- For JDK 1.2, include `dt.jar`

- For JRE 1.2, include `rt.jar`

For any interaction with JDBC, include the following ZIP file:

    $ORACLE_HOME/jdbc/lib/classes12.zip

For any client that uses SSL, include the following JAR files:

    $ORACLE_HOME/jlib/jssl-1_2.jar
    $ORACLE_HOME/jlib/javax-ssl-1_2.jar

#### JAR Files Included for Clients that use SQLJ

    $ORACLE_HOME/sqlj/lib/translator.zip

In addition to this files, add the appropriate `runtime` `X``.zip` file, as follows:

- Java 2 client using JDBC 8.1.7--`$ORACLE_HOME/sqlj/lib/runtime12.zip`

- Java 2 Enterprise Edition client using JDBC 8.1.7--`$ORACLE_HOME/sqlj/
  lib/runtime12ee.zip`

- JDK 1.1 client using JDBC 8.1.7--`$ORACLE_HOME/sqlj/
  lib/runtime11.zip`

- Any JDK client using JDBC 8.1.6 or previous version--`$ORACLE_HOME/sqlj/
  lib/runtime.zip`

#### JAR Files Included for Clients that use JSP

    $ORACLE_HOME/jsp/lib/ojsp.jar
    $ORACLE_HOME/lib/xmlparserv2.jar
    $ORACLE_HOME/lib/servlet.jar

If your JSP pages use OracleJML tags or database utility JavaBeans, add the following:

    $ORACLE_HOME/jsp/lib/ojsputil.jar
    $ORACLE_HOME/jsp/lib/oraclexmlsql.jar

See the appropriate feature documentation for more information. You can also see examples of these JAR and ZIP files used in both the readme or makefile within the feature demo samples.

### 3. Verify the Port/SID

If you do not configure the default listener port numbers or database SID in your installation--such as ports 1521, 2481, and SID `orcl`--the samples will not work correctly. All the samples expect the default port numbers and database SID provided by an Oracle8i Typical install. If you have different values, specify the new port numbers as follows:

Host type | Directions
--- | ---
UNIX | $ make SERVICE=sess_iiop://localhost:myportnum:mysid
Windows NT | In the control panel, set the system environment variable ORACLE_SERVICE to sess_iiop://localhost:myportnum:mysid

### 4. Test Install with Samples

We provide a set of samples in `$ORACLE_HOME/javavm/demo/demo.tar` (or `demo.zip` for Windows NT). These samples compile and run for a database installed with the Oracle8i Typical install option. Execute these samples as a test of your installation.

    $ORACLE_HOME/javavm/demo/examples/jsp/helloworld
    $ORACLE_HOME/javavm/demo/examples/corba/basic/helloworld
    $ORACLE_HOME/javavm/demo/examples/ejb/basic/helloworld

If these samples do not compile or run, your environment is incorrect. Similarly, if these samples compile and run, but your code does not, then a problem exists within your build environment or code.

Note: It is important that you run these examples using the supplied Makefiles (or batch files on NT) when verifying your installation.

Verify that the samples work before using more complex build environments, such as Visual Cafe, JDeveloper, or VisualAge.

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index