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:

  1. Write Java code with keyword/syntax highlighting, content assist, etc
  2. Incrementally / automatically compile with instant feedback of errors annotated in the source
  3. Test and debug code on your workstation (so long as it doesn't have z/OS system dependencies).
  4. One-click deploy your code to z/OS by using the Eclipse Ant integration.
  5. 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

  1. 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)
  2. Download the 3.1 build of the Eclipse Platform SDK
  3. Unzip the build to the target directory, for example: C:\Program Files\
    (this will create a "eclipse" subdirectory)
  4. (Optional) Create a shortcut to eclipse.exe
  5. Launch eclipse.exe (or your shortcut)

    If Eclipse won't start, refer to the Eclipse FAQ

    Otherwise you should see:

    Eclipse workspace selection
  6. 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:

    eclipseWelcome
  7. Close the "Welcome" tab and from the "Window" menu, open a Java perspective:

    Open Java Perspective


Empty 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.

  1. Create a new directory called, for example:  C:\Program Files\eclipse\ant_jars
  2. 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.
  3. To add these Jars to your default Eclipse Ant path, first select the "Window / Preferences" menu and select the Ant  runtime settings:


    Ant runtime preferences

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

    Add required Ant jars


    Press "OK" to save the Ant Preferences.

Installing the JZOS Batch Sample Project

  1. Download the JZOS_BatchSample project  to your Eclipse workspace ( C:\Program Files\eclipse\workspace ).
  2. From the Eclipse workbench,  select the menu  "File - Import..." 

    Import Project

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

    Import Batch Sample

    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
  4. Press the "Finish" button.

    Batch Sample Project


Deploying an application to z/OS

  1. In the JZOS_BatchSample project, open the zos.properties file and change it for your environment.

    Notes: 
                -  the server property should be the TCP/IP host name or address of your z/OS server.
                -  userid and password are your z/OS creditials which are used upload / deploy via FTP.
                -  the jcl.dsn is the name of the PDS where sample JCL is uploaded.
                -  app.home is the HFS directory where your application jar is deployed.

    zos.properties


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

    Sample JCL


    Tailor this JCL per the instructions.

  3. 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..."


    run Ant deploy.xml


    Run Ant dialog

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

    deploy.xml results


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

    External Tools button


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


    3270 job log