IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Java Batch launcher JVMPRC86 does not find jar files


IBM Mainframe Forums -> IBM Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Wed Apr 15, 2020 12:37 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 15, 2020 1:09 am
Reply with quote

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
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Wed Apr 15, 2020 2:17 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IBM Tools

 


Similar Topics
Topic Forum Replies
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Excuting store procedure via JCL batch JCL & VSAM 1
No new posts 3 files concatenated to 1 DFSORT/ICETOOL 2
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
Search our Forums:

Back to Top