Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Java Batch launcher JVMPRC86 does not find jar files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IBM Tools
View previous topic :: :: View next topic  
Author Message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 66

PostPosted: Wed Apr 15, 2020 12:37 am    Post subject: Java Batch launcher JVMPRC86 does not find jar files
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: 8551
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 15, 2020 1:09 am    Post subject:
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: 66

PostPosted: Wed Apr 15, 2020 2:17 am    Post subject:
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://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    IBMMAINFRAMES.com Support Forums -> IBM Tools All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PKZIP - extracting multiple txt files drarem All Other Mainframe Topics 3 Tue Jul 07, 2020 8:47 pm
No new posts ISPF Edit Macro with profile commands... Lynne Schuler TSO/ISPF 14 Thu Jun 18, 2020 7:25 pm
No new posts Batch JCL to Copy from Unix Directory... satish.ms10 JCL & VSAM 5 Tue May 19, 2020 7:53 pm
No new posts Compare multiple files using JCL/Rexx... tanvi110788 JCL & VSAM 4 Tue May 19, 2020 5:47 pm
No new posts Need help to concatenate files with w... ssuthagar All Other Mainframe Topics 3 Fri May 15, 2020 1:39 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us