How To
Summary
Developing Java applications for z/OS and utilizing the Java™ Batch Launcher Toolkit for z/OS® (JZOS) libraries will require the use of the IBM JZOS jar files. The IBM JZOS jar files are part of the Java™ Batch Launcher and Toolkit that is installed on the host, however due to license restrictions they may not be copied to local client side workstations. To develop your Java applications locally on your workstation, you will need the IBM JZOS jar files. IBM makes available a limited version of the IBM JZOS jar file that when added to your Java project will resolve JZOS library dependencies. This limited JZOS jar file is available via Maven. This set of instructions will allow you to integrate Maven into your Visual Studio Code (VS Code) Java project and link in the limited IBM JZOS jar library.
Note: The limited IBM JZOS jar file from Maven will only allow you to build and compile your Java program and resolve your JZOS dependencies. Your java program will not run locally because it needs access to mainframe resources.
Steps
From Windows Command Prompt:
java -version
2. Download and Install VS Code if it is not already installed.
https://code.visualstudio.com/download
3. Check if you have Maven Installed and it is accessible from within VS Code.
a) Start VS Code
b) Terminal -> New Terminal
c)
mvn --version
(If you get a Maven Version returned then Maven is installed and accessible. Proceed to Step 7)
4. Download Apache Maven.
https://maven.apache.org/download.cgi
5. Unzip it somewhere on your workstation.
6. Add the Maven bin directory location to your windows path.
a) Windows-> System -> About -> Advanced System Settings -> Environment Variables -> Edit Path entry and add the Maven bin location. A restart of VS Code is required if VS Code was already open.
b) Check if Maven Installed and its accessible in VS Code:
a) Start VS Code
b) Terminal -> New Terminal
c)
mvn --version
7. Chack if the Maven Plugin Extension is integrated with VS Code. It’s a good idea to install the “Extension Pack for Java” which contains the Maven extension as part of the package.
Extensions -> Extension Pack for Java -> Install (Proceed to Trust the install)

8. Download Sample Projects that use the JZOS Toolkit.
Find JZOS Samples then download and unzip it to a directory.
https://www.ibm.com/docs/en/sdk-java-technology/8?topic=components-jzos-batch-launcher-toolkit
9. Create a new Java Maven Project.
a) Select: Create Java Project Button
b) Select Wizard: Maven create from archetype

c) Select maven-archetype-quickstart

d) Select latest Version: 1.4 (at time of writing)

e) Input your Java project a group id: eg com.ibm.jzos.sample

f) Input your java application name as the artifact Id: (lower case only)

h) Select a destination folder where this project will be created under: eg Maven Java Projects
I) When prompted, Trust the authors by selecting the checkbox followed by Yes. (you created it)

J) Now you should have a Java and Maven Project in your File Explorer

k) Expand and open Main. Notice you now have a pom.xml file which is the Maven project management file.

l) Edit the Main.java file then copy and paste some code from one of the samples you found in the JZOS samples zip file. Make sure it uses one some functions from the com.ibm.jzos libraries.
m) Rename the Main.java file to correspond with the name of the java sample you are using. Eg CatalogSearchSample.java

n) Notice that you have several unresolved dependencies for com.ibm.jzos . We will use Maven to locate and download the missing dependencies.

o) Determine which JZOS library you need to include in your project depending on the Java version you have installed.

p) Click on Maven Dependencies under the Java Projects folder then click the + (Add dependencies button)

q) Enter either ibm.jzos or ibmjzos in the search field depending on the Java version you are using.

r) Select the appropriate JZOS jar file and notice that your project pom.xml file will open up and the JZOS library will have been added. SAVE your pom.xml file.

s) Once you save the pom.xml file a build and synchronize process will begin. Select Yes

t) Now your dependencies should be resolved.

u) You can compile your project using Maven commands.
Right click on your Maven project -> Run Maven Commands -> Compile

v) You may need to edit the Java compiler version that Maven uses:

Additional Information
C:\Users\<username>\.m2\repository




Ctrl+Shipt+P -> maven -> Execute Maven Commands

Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
20 February 2024
UID
ibm17121508