View previous topic :: View next topic
|
Author |
Message |
harisukumaran
New User
Joined: 14 Jun 2005 Posts: 75
|
|
|
|
Batch launcher does not find jar files unless there full path is specified
The manual says it should find it:
"An executable JAR file may be launched by specifying "-jar <jar file name>" in
place of a main class name."
Code: |
//JAVA EXEC PROC=JVMPRC86,
// JAVACLS='-jar HelloJar.jar'
|
does not work even though APP_HOME is specified and jar file is present there
Code: |
APP_HOME=/u/user1/jar
CLASSPATH=$APP_HOME:"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext
# Add Application required jars to end of CLASSPATH
for i in "${APP_HOME}"/*.jar; do
CLASSPATH="$CLASSPATH":"$i"
done
export CLASSPATH="$CLASSPATH":
JVMJZBL1050E Error reading jarfile "HelloJar" for -jar option
JVMJZBL2007E Stack trace follows:
java.io.FileNotFoundException: HelloJar (EDC5129I No such file or directory.)
:at java.util.zip.ZipFile.open(Native Method)
|
Batch launcher successfully runs the programs if the path of the jar is mentioned in the exec statement as :
Code: |
//JAVA EXEC PROC=JVMPRC86,
// JAVACLS='-jar /u/user1/jar/HelloJar.jar'
|
Is there a fix for this ?[/code] |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
What does your batch job have for //STDENV? IIRC, from using batch Java some years ago, the batch job does not inherit your OMVS environment and hence you need to provide the APP_HOME and other statements as part of the batch job. |
|
Back to top |
|
|
harisukumaran
New User
Joined: 14 Jun 2005 Posts: 75
|
|
|
|
I am just using the standard JCL supplied by IBM
All I am changing are loadlib and APP_HOME as per directions in ftp.software.ibm.com/software/Java/Java80/JZOS/jzos_users_guide_v8.pdf
This is what is under //STDENV
Code: |
//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/J8.0_64
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
export LIBPATH="$LIBPATH":
# Customize your CLASSPATH here
# APP_HOME=$JAVA_HOME
APP_HOME=/u/user1/jar
CLASSPATH=$APP_HOME:"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext
# 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 " |
|
|
Back to top |
|
|
|