You can run remote programs or builds in a number of ways: using
compile commands, run launch configurations, a remote shell, or external tools.
When you use compile commands, you navigate to the program on the remote server
you want to run, right-click, and invoke compile commands based on default
input. When you launch a remote shell, you can navigate to your remote directory,
and run builds directly on the remote server. These methods are suitable if
you only need to run a remote program occasionally, but, to work in a more
managed project environment you can use external tool launch configurations.
The following documentation describes how to use external tools to run your
programs remotely. This function applies to programs that reside on your IBM® i Integrated
File System (IFS), or on a remote Window, Linux, UNIX, or AIX® server.
About this task
External tools represent a standard Eclipse framework designed
so that you can configure and invoke tools that run outside of Eclipse. Once
you create an external tool configuration, you can invoke the same action
quickly and easily with a toolbar or workbench menu shortcut. That way, you
can configure a configuration to build your remote project, once such a configuration
exists, you only need to click it once to reinvoke it.
To create an
external tool launch configuration:
Procedure
- From the workbench menu, click .
- From the configurations list on the left side of the dialog box,
select Remote Build.
- At the bottom of the dialog box, click New.
- In the Name field, type an appropriate name for your configuration,
such as Project Build A.
- In the Connection field, use the drop-down
list to select the connection you are using to connect to your remote server.
(If you do not already have a connection to a remote server, expand New
Connection and complete the dialog box. See Configuring
a connection to a remote server for more information.)
- In the Build Invocation field, type the
command you want to run on the server, for example, javac *.java.
This is the command that runs when you invoke the remote build.
- In the Working Directory field, click Browse
File System. Browse to the directory on the remote server where
you want the build to run. Click OK. Here is an example
of what your dialog box should look like so far:
- Check the Has associated project if you
are using a local package of remote code. If you are working in a managed
project environment, a local project is advantageous because it provides a
local container for your remote source, which you can work with while connected
to the remote server or offline.
- Check the Export files before running build if
you want to export your source right before invoking a remote build. This
lets you skip the task of having to synchronize your source with the remote
server every time you want to run a remote build. This option complements
the option to work with an associated local project, because all of the source
in the project will be exported before the build begins.
- Click the Environment tab. Here, you can enter new environment
variables, or select existing variables to modify. For the purposes of this
task, click Select and check the two variables for
HOST and LOGNAME. Click OK.
- Click the Common tab to define additional
properties for the configuration:
- Select whether you want this configuration to be local to your
workbench instance, or shared with your team.
- Select the External Tools toolbar check
box, so that the configuration will display as a favorite (a bookmarked shortcut)
- At the bottom of the dialog box, click Apply to
save the configuration.
Results
Now that you have created the configuration, you can run it against
your remote resources in a single step. You can now click the down-arrow next
to the external tools toolbar button

and select Project Build A

. You can also select from
the workbench menu:
This action runs the configuration against any selected remote
resources. To edit the configuration, click again and select the configuration. Make any modifications
and click Apply. You can also right-click the configuration and select Duplicate to
work from a copy of the configuration, so that, for example, you can save
a new configuration that contains one or two different environment variables.