AS/400 Toolbox for Java \ Access classes \ Java applicationcall

JavaApplicationCall

Start changeThe JavaApplicationCall class provides you with the ability to easily run a Java program residing on the AS/400 from a client with the Java virtual machine for AS/400.

After establishing a connection to the AS/400 from the client, the JavaApplicationCall class lets you configure the following:

  1. Set the CLASSPATH environment variable on the AS/400 with the setClassPath() method
  2. Define your program's parameters with the setParameters() method
  3. Run the program with run()
  4. Send input from the client to the Java program. The Java program reads the input via standard input which is set with the sendStandardInString() method. You can redirect standard output and standard error from the Java program to the client via the getStandardOutString() and getStandardErrorString()

JavaApplicationCall is a class you call from your Java program. However, the AS/400 Toolbox for Java also provides utilities to call AS/400 Java programs. These utilities are complete Java programs you can run from your workstation. See RunJavaApplication class for more information.

Example

This example shows you how to run a program on the AS/400 from the client that outputs "Hello World!". End change
[ Information Center Home Page | Feedback ] [ Legal | AS/400 Glossary ]