IBM Books

Administration and Programming Guide for OS/400

Calling Java Programs

To call a Java program, define a function that uses the Java Application (DTW_JAVAPPS) language environment. Specifying a function name that represents the class name of the Java program.

Example: Calls a Java program helloWorld.java:

 %function(DTW_JAVAPPS) helloWorld() { %}

The Java Application language environment expects Java programs to contain a method identifier for 'main,' the first method that is run in a Java program. When the language environment invokes an application, the application has access to stdin and stdout. There is no form data in stdin because Net.Data has already read the data.

Important: Before calling Java applications, set the DTW_JAVA_CLASSPATH path configuration variable so that the Java class can be found. See DTW_JAVA_CLASSPATH for the syntax of this variable.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]