Running Java programs remotely

You can run an iSeries Java program remotely in the iSeries Java Transform and Run view or in the Launch Configurations window.

Any Java program that you run must be an application (a class that contains a main method).

Before you can run an iSeries Java program, you must export Java class files to an iSeries integrated file system directory. Java source files are required on an iSeries server to debug iSeries Java programs.

In the iSeries Java Transform and Run view

  1. Open a Java perspective if one is not currently available: Click Window > Open Perspective > Java.
  2. Switch to the Transform and Run view:
    1. Click the down arrow next to the run icon Run icon (circle containing arrow) on the workbench menu bar.
    2. Select Run As > Remote Java Application in iSeries view.
  3. To populate the Working Folder field, click Browse to select a directory in the Browse For Folder window.
  4. Optional: Click Advanced Options to specify program parameters, properties, and iSeries run options. In the Select iSeries Options window, choose the properties you want and click OK. The options are described in the related references below.
  5. Click the Run remotely tab.
  6. In the Class field, enter the name of the class file.
  7. Click Run to start the remote invocation. The Console out field displays output or any errors.
  8. Use the Console in field to enter information for the program (if the program asks for input). Data entered in this field is passed to the remote program when you press Enter.

The Java application runs on the iSeries server. At any time while the program is running, you can click Stop. Click Clear Console to clear the Console out field.

In the Launch Configurations window

  1. Open a Java perspective if one is not currently available: Click Window > Open Perspective > Java.
  2. Click the down arrow next to the run icon Run icon (circle containing arrow) on the workbench menu bar.
  3. Select Run. The Launch Configurations window opens.
  4. Click Java application in iSeries server. Click New.
  5. Optional: Give the configuration a name.
  6. Under the Main tab, fill in the name of the project and the name of the Main class in your project. Browse to the Remote iSeries working folder, enter the name, or select the name from the drop-down list. This is the IFS folder containing the remote package, or the class itself if the class does not have a package.
  7. Optional: Use the other tabs to add parameters, set class path, and so on.
  8. Click Run to run the program.

After you define a configuration, it appears as a shortcut in the down-arrow menu.

If the Java class file is on the IFS, you can run it in the Remote Shell view. In the Remote System Explorer, right-click the IFS Files subsystem under the connection and select Launch Shell. See the related task on working with command shells.
Related concepts
iSeries Java transformer
Related tasks
Developing iSeries Java applications
Transforming Java class files into iSeries programs
Debugging Java programs remotely
iSeries options for transform, run, and debug
Finding job logs for Java problem analysis
Working with command shells