IBM JZOS batch launcher user's guide

The IBM JZOS batch launcher is an MVS batch program that configures and starts the Java™ virtual machine (JVM). You can run it as an MVS batch job or as a started task. The following stored procedure to run the JZOS batch launcher is distributed with the IBM® SDK.

Sample PROC file

The following sample is distributed in the mvstools/jcl directory. This sample PROC file is for IBM Semeru Runtime Certified Edition for z/OS®, 21

//********************************************************************
//* Licensed Materials - Property of IBM
//* 5655-UA1
//* Copyright IBM Corp. 1997, 2024
//* STATUS = HJVBH00
//*
//* Stored procedure for executing the JZOS Java Batch Launcher
//*
//* Tailor the proc your installation:
//* If the PDSE containing the JVMLDMxx module is not in your
//* LNKLST, uncomment the STEPLIB statement and update the DSN to
//* refer to the PDSE
//*
//*******************************************************************
//JVMPRC21 PROC JAVACLS=,                < Fully Qfied Java class..RQD
//   ARGS=,                              < Args to Java class
//*  LIBRARY='<HLQ>.JZOS.LOADLIB',       < STEPLIB FOR JVMLDM module
//   VERSION='21',                       < JVMLDM version: 21
//   LOGLVL='',                          < Debug LVL: +I(info) +T(trc)
//   REGSIZE='0M',                       < EXECUTION REGION SIZE
//   LEPARM=''
//JAVAJVM  EXEC PGM=JVMLDM&VERSION,REGION=&REGSIZE,
//   PARM='&LEPARM/&LOGLVL &JAVACLS &ARGS'
//* STEPLIB  DD DSN=&LIBRARY,DISP=SHR
//SYSPRINT DD SYSOUT=*          < System stdout
//SYSOUT   DD SYSOUT=*          < System stderr
//STDOUT   DD SYSOUT=*          < Java System.out
//STDERR   DD SYSOUT=*          < Java System.err
//CEEDUMP  DD SYSOUT=*
//ABNLIGNR DD DUMMY
//*
//*The following DDs can/should be present in the calling JCL
//*
//*STDIN   DD                   < OPTIONAL - Java System.in
//*STDENV  DD                   < REQUIRED - JVM Environment script
//*MAINARGS DD                  < OPTIONAL - Alt. method to supply args
// PEND

Sample JCL file

The following sample is distributed in the mvstools/jcl directory. This sample JCL file is for IBM Semeru Runtime Certified Edition for z/OS, 21.
//*******************************************************************
//* Licensed Materials - Property of IBM
//* 5655-UA1
//* Copyright IBM Corp. 1997, 2024
//* STATUS = HJVBH00
//*
//* Batch job to run the Java VM
//*
//* Tailor the proc and job for your installation:
//* 1.) Modify the Job card per your installation's requirements
//* 2.) Modify the PROCLIB card to point to this PDS
//* 3.) edit JAVA_HOME to point the location of the SDK
//* 4.) edit APP_HOME to point the location of your app (if any)
//* 5.) Modify the CLASSPATH as required to point to your Java code
//* 6.) Modify JAVACLS and ARGS to launch desired Java class
//*
//*******************************************************************
//JAVA EXEC PROC=JVMPRC21,
// JAVACLS='HelloWorld'
//STDENV DD *
# This is a shell script which configures
# any environment variables for the Java JVM.
# Variables must be exported to be seen by the launcher.
. /etc/profile
export JAVA_HOME=/usr/lpp/java/J21.0_64
export PATH=/bin:"${JAVA_HOME}"/bin
LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/j9vm
export LIBPATH="$LIBPATH":

# Customize your CLASSPATH here
APP_HOME=$JAVA_HOME
CLASSPATH=$APP_HOME:"${JAVA_HOME}"/lib

# Add Application required jars to end of CLASSPATH
for i in "${APP_HOME}"/*.jar; do
    CLASSPATH="$CLASSPATH":"$i"
    done
export CLASSPATH="$CLASSPATH":

# Set JZOS specific options
# Use this variable to specify encoding for DD STDOUT and STDERR
#export JZOS_OUTPUT_ENCODING=Cp1047
# Use this variable to prevent JZOS from handling MVS operator commands
#export JZOS_ENABLE_MVS_COMMANDS=false
# Use this variable to supply additional arguments to main
#export JZOS_MAIN_ARGS=""
# Configure JVM options
IJO="-Xms16m -Xmx128m"
# Uncomment the following to aid in debugging "Class Not Found" problems
#IJO="$IJO -verbose:class"
# Uncomment the following if you want to run with Ascii file encoding..
#IJO="$IJO -Dfile.encoding=ISO8859-1"
export IBM_JAVA_OPTIONS="$IJO "
//