You are here :: Home :: Documentation :: JZOS :: Setting up Eclipse
Setting up Eclipse
The open source Eclipse
Java Development Tools Project
is a great tool
for developing z/OS batch Java applications. With it, you
can:
- Write Java code with keyword/syntax highlighting, content assist, etc
- Incrementally / automatically compile with instant feedback of errors annotated in the source
- Test and debug code on your workstation (so long as it doesn't
have z/OS system dependencies).
- One-click deploy your code to z/OS by using the Eclipse Ant integration.
- Remotely debug your z/OS Java applications from the same great
Eclipse debugger
This document describes the steps necessary to install Eclipse
and configure it for use with JZOS.
A sample Eclipse project is available
to get you started.
Installing the Eclipse Platform SDK
- Verify that you have a supported Java SDK (for this example,
version 1.4.2) installed on your workstation.
From a command / shell prompt:java -version
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
- Download the 3.1 build of the Eclipse Platform SDK
- Unzip the build to the target directory, for example:
C:\Program Files\
(this will create a "eclipse" subdirectory) - (Optional) Create a shortcut to
eclipse.exe - Launch eclipse.exe (or your shortcut)
If Eclipse won't start, refer to the Eclipse FAQ
Otherwise you should see:

- The Eclipse "workspace" is the directory under which Eclipse
stores your
projects and meta data about your projects.
Confirm the location of your workspace, and press "OK".
Next, you'll see a Welcome screen:

- Close the "Welcome" tab and from the "Window" menu, open a Java
perspective:

Configuring Eclipse for using the Ant FTP task
In order to use the optional Ant "FTP" task from within Eclipse, we
will need to download some required library jars and configure them.- Create a new directory called, for example:
C:\Program Files\eclipse\ant_jars - Download the following zip files and extract the indicated jar
file (current release) to the directory created in step 1:
Apache Jakarta commons.net binary zip - commons-net-1.4.0.jar
Apache Jakarta ORO binary zip - commons-oro-2.0.8.jar
Ensure that these individual jars are placed directly in the ant_jars directory.
- To add these Jars to your default Eclipse Ant path, first select
the "Window / Preferences" menu
and select the Ant runtime settings:

- Select "Ant Home Entries" and press the "Add External JARs..."
button and select both files from the ant_jars directory

Press "OK" to save the Ant Preferences.
Installing the JZOS Batch Sample Project
- Download the JZOS_BatchSample project to your Eclipse workspace (
C:\Program Files\eclipse\workspace). - From the Eclipse workbench, select the menu "File - Import..."

Select "Existing Projects into Workspace".
-
Press the "Next >" button.

Select the "Select archive file:" radio button and browse to the JZOS_BatchSample.zip file you downloaded earlier.
Once this file is selected, the JZOS_BatchSample project should appear in the Projects: list
- Press the "Finish" button.

Deploying an application to z/OS
- In the JZOS_BatchSample project, open the zos.properties file and
change it for your environment.
Notes:
- theserverproperty should be the TCP/IP host name or address of your z/OS server.
-useridandpasswordare your z/OS creditials which are used upload / deploy via FTP.
- thejcl.dsnis the name of the PDS where sample JCL is uploaded.
-app.homeis the HFS directory where your application jar is deployed.

- From the Package Explore view, select the "jcl" folder and open
the file "SAMPLE14"

Tailor this JCL per the instructions.
- To deploy the Java application and upload the sample JCL, select
the file "
deploy.xml" and with the right mouse button, select "Run - Ant Build..."


Select the "Run" button to run the Ant script, which by default will deploy your JAR file and sample JCL to z/OS:

Once you have run an Ant script once, you can easily pick it again with one click using the "External Tools" toolbar button.:

- The sample JCL provided, which was uploaded by the Ant deploy.xml
script, can be used to submit your batch Java job.
