jvm_default_conf.sh - Configuration Library on USS
# 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
#######################################
### base variables ###
#######################################
# Jopaz install location
export JPZ_INSTALLATIONPATH=JPZ_INSTALLATIONPATH
# Jopaz output directory for Java classes
export JPZ_OUTPUTDIRECTORY=JPZ_OUTPUTDIRECTORY
# Java install location
export JAVA_HOME=JPZ_JAVALOCATION64
# CLASSPATH variable for later use
export CLASSPATH="$CLASSPATH"
#######################################
### check enviroment ###
#######################################
if [ ! -f ${JPZ_INSTALLATIONPATH}jpz-jar/jopaz.jar ]
then
echo "ERROR: No Jopaz compiler found at: ${JPZ_INSTALLATIONPATH}jpz-jar/jopaz.jar."
echo "==> wrong JPZ_INSTALLATIONPATH in jvm_default_config.sh"
exit 1
fi
#######################################
### default config functions ###
#######################################
get_default_lib_path () {
export PATH=/bin:"${JAVA_HOME}"/bin
LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390x
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390x/j9vm
LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
LIBPATH="$LIBPATH":"${JPZ_INSTALLATIONPATH}"jpz-lib
export LIBPATH="$LIBPATH":
export LD_LIBRARY_PATH="$LIBPATH"
}
get_default_compiler_conf () {
APP1="${JPZ_INSTALLATIONPATH}"jpz-jar/jopaz.jar
APP1="${APP1}":"${JPZ_INSTALLATIONPATH}"jpz-jar/jpz-tools.jar
APP1="${APP1}":"${JPZ_INSTALLATIONPATH}"jpz-jar/lic-utils.jar
CLASSPATH="${CLASSPATH}":"${APP1}"
CLASSPATH="${CLASSPATH}":"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext
}
get_default_db2_conf () {
# DB2 specification example ### PLEASE REVIEW AND POSSIBLY ADAPT ###
DB2=/usr/lpp/db2c10/jdbc/classes/db2jcc_javax.jar
DB2="${DB2}":/usr/lpp/db2c10/jdbc/classes/db2jcc_license_cisuz.jar
DB2="${DB2}":/usr/lpp/db2c10/base/lib/clp.jar
DB2="${DB2}":/usr/lpp/db2c10/jdbc/classes/db2jcc4.jar
DB2="${DB2}":/usr/lpp/db2c10/jdbc/classes/sqlj4.zip
CLASSPATH="${CLASSPATH}":"${DB2}"
}
get_default_runtime_dependencies () {
compiler="${JPZ_INSTALLATIONPATH}"jpz-jar/jopaz.jar
compiler="$compiler":"${JPZ_INSTALLATIONPATH}"jpz-jar/jpz-tools.jar
compiler="$compiler":"${JPZ_INSTALLATIONPATH}"jpz-jar/lic-utils.jar
compiler="$compiler":"${JPZ_INSTALLATIONPATH}"jpz-jar/jpz-apis.jar
output="${JPZ_OUTPUTDIRECTORY}"jpz-compiler/output/
CLASSPATH="$CLASSPATH":"$output":"$compiler"
CLASSPATH="$CLASSPATH":"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext
APP_HOME=""
# Add Application required jars to end of CLASSPATH
for i in "${APP_HOME}"/*.jar
do
CLASSPATH="$CLASSPATH":"$i"
done
}
get_default_JVM_execute_conf () {
# Set JZOS specific options
# Use this variable to specify enc
export JZOS_OUTPUT_ENCODING=Cp1047
# Configure JVM options
IJO=" -Djopaz.conf.mvs=1"
# Uncomment the following to aid in debugging "Class Not Found" problems
#IJ1=" -verbose:class"
# Uncomment the following if you want to run with Ascii file encoding..
#IJ2=" -Dfile.encoding=ISO8859-1"
export IBM_JAVA_OPTIONS="$IJO"
}
get_default_JVM_compile_conf () {
# Configure JVM options
IJO=" -Djopaz.conf.mvs=1"
# Uncomment the following to aid in debugging "Class Not Found" problems
#IJ1=" -verbose:class"
# Uncomment the following if you want to run with Ascii file encoding..
#IJ2=" -Dfile.encoding=ISO8859-1"
export IBM_JAVA_OPTIONS="$IJO"
}
#######################################
### helper functions ###
#######################################
set_permissions () {
find "${JPZ_OUTPUTDIRECTORY}"jpz-compiler -user $(whoami) | xargs chmod 770
}