Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Programming Guide

Interfacing with Java

What is the Java Native Interface (JNI)?
JNI Sample Program #1 - 'Hello World'
Writing Java Sample Program #1
Step 1: Writing the Java Program
Step 2: Compiling the Java Program
Step 3: Writing the PL/I Program
Step 4: Compiling and Linking the PL/I Program
Step 5: Running the Sample Program
JNI Sample Program #2 - Passing a String
Writing Java Sample Program #2
Step 1: Writing the Java Program
Step 2: Compiling the Java Program
Step 3: Writing the PL/I Program
Step 4: Compiling and Linking the PL/I Program
Step 5: Running the Sample Program
JNI Sample Program #3 - Passing an Integer
Writing Java Sample Program #3
Step 1: Writing the Java Program
Step 2: Compiling the Java Program
Step 3: Writing the PL/I Program
Step 4: Compiling and Linking the PL/I Program
Step 5: Running the Sample Program
JNI Sample Program #4 - Java Invocation API
Writing Java Sample Program #4
Step 1: Writing the Java Program
Step 2: Compiling the Java Program
Step 3: Writing the PL/I Program
Step 4: Compiling and Linking the PL/I Program
Step 5: Running the Sample Program
Determining equivalent Java and PL/I data types

This chapter gives a brief description of Java and the Java Native Interface (JNI) and explains why you might be interested in using it with PL/I. A simple Java - PL/I application will be described and information on compatibility between the two languages will also be discussed. Instructions on how to build and run the Java - PL/I sample applications assume the work is being done in the z/OS UNIX System Services environment of z/OS.

Before you can communicate with Java from PL/I you need to have Java installed on your z/OS system. Contact your local System Administrator for more information on how to set up your z/OS Java environment.

These sample programs have been compiled and tested with Java 2 Version 1.4.2. To determine the level of Java in your z/OS UNIX System Services environment enter this command from the command line:

java -version

The active Java version will then be displayed and will look something like:

Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM z/OS Persistent Reusable VM build cm142

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)