View previous topic :: View next topic
|
Author |
Message |
sriram.mukundan
New User
Joined: 20 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
Hi Guys,
Can you Please tell me whether we can compile/Run Java application in Host ??
Please Let me know. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
As long as your system programmers have installed the Java VM for your version of z/OS, you can compile and run Java programs. You need to check with your site system programmers. |
|
Back to top |
|
|
sriram.mukundan
New User
Joined: 20 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
Thanks!!!
How to Check whether Java VM is there in My system ? |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
sriram.mukundan wrote: |
Thanks!!!
How to Check whether Java VM is there in My system ? |
ASK! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Code: |
//BPXBATCH EXEC PGM=BPXBATCH,
// PARM='sh java -version',
// REGION=0M
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=* |
|
|
Back to top |
|
|
sriram.mukundan
New User
Joined: 20 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
thank u!!!
Robert if u don mind can u tell me in detail. pls. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Please add a proper job card and submit the suggested step and then post the output back here.
From what is presented by that run, you should be able to see what you need. If not, possibly we can help. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
As far as I know, Java does not run under z/OS directly -- you cannot have a batch job EXEC PGM=JAVA and expect results. Java on z/OS runs under Unix System Services. BPXBATCH is one of the ways to invoke Unix System Services through JCL. The parm sh java -version indicates to Unix System Services that a shell is being invoked, that the shell is to start up Java, and Java is to return the version information.
The first possible result is something along the lines of
Code: |
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pmz64dev-20061002b (SR3)
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 z/OS s390x-64 j9vmmz6423-20061002 (J
J9VM - 20060915_08260_BHdSMr
JIT - 20060908_1811_r8
GC - 20060906_AA)
JCL - 20061002 |
which gives the requested information.
The second possible result is a security violation due to the user id being used to submit the batch job not having access to Unix System Services (in RACF, an OMVS segment must be defined for the user id, and there are requirements for the OMVS segment). There is also a chance that the user id is not allowed to run java.
The third possible result is an abend due to Java not being present on your system. Depending on the version of z/OS you're running on, Java may or may not be available. |
|
Back to top |
|
|
sriram.mukundan
New User
Joined: 20 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
Hi Robert,
Thanks for the information... !!! Really helpful
I just executed the Job which you gave me.
Exec pgm=BPXBATCH
I didnt get the proper output...
I do know that java can't be directly compiled in Host , thruogh SH only i can invoke.
Let me try again and post my results.
Thanks!!!! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Sriram: make sure you've got lower case characters in the PARM=; Unix is case-sensitive and SH JAVA -VERSION isn't going to work. |
|
Back to top |
|
|
sriram.mukundan
New User
Joined: 20 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
Hi Robert,
This is my Job.
//JAVAJB JOB NOTIFY=&SYSUID
//BPXBATCH EXEC PGM=BPXBATCH,
// PARM='sh java -version'
//STDIN DD DUMMY
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//STDPARM DD SYSOUT=*
Now my friend also executed the same Job.
Message in his spool :
Maxcc=3840
stderror had this
FSUM1004 Cannot change to directory </nohome>.
I got different error. I will paste it tomorrow.
May i know before running this job do i need to set anything ? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
The FSUM1004 is probably due to a security problem. The RACF OMVS segment has shell program (normally /bin/sh) and the home directory (which is typically but not always /u/userid); it appears your friend's user id does not have a home directory set. I don't know the equivalent items in ACF2 or TOP SECRET since we're using RACF here.
You should not need to set anything to run this job as /etc/profile has the global profile settings and should include the path to the java binary. |
|
Back to top |
|
|
sriram.mukundan
New User
Joined: 20 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
Hi Robert,
Code: |
//JAVAJB JOB 'IBMMFS','MAC',CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//BPXBATCH EXEC PGM=BPXBATCH,
// PARM='sh java -version'
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=* |
I got MAXCC as '0'. but i didnt correct output in stdout.
Display in STDOUT is
SDSF OUTPUT DISPLAY JAVAJB JOB08232
COMMAND INPUT ===>
*********************************
-c java -version
*********************************
Display in STDERR is
********************************* TOP OF DATA ************
FSUM1012 The initial working directory was not specified.
******************************** BOTTOM OF DATA **********
Pls help me !!! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
From the Unix System Services Message and Codes manual:
Quote: |
FSUM1012 The initial working directory was not specified.
Explanation: The initial working directory was not specified in the OMVS segment of the user's RACF profile. The initial working directory will be set to the root (/) directory. Processing continues.
User Response: Contact the system programmer.
System Programmer Response: Verify that the OMVS segment of the user's RACF profile contains an initial working directory. |
Sriram: you'll need to have the RACF (or other security package) administrator add a home directory (and possibly shell program) to your OMVS segment. Without access to OMVS, you're not going to be doing any Java. |
|
Back to top |
|
|
sriram.mukundan
New User
Joined: 20 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
Hi Robert,
one of team mate has the Access to OMVS. i tried running the job. it was showing properly as your's.
Quote: |
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pmz64dev-20061002b (SR3)
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 z/OS s390x-64 j9vmmz6423-20061002 (J |
now we are trying to compile the small java program. Just displaying say hello!!!, we have coded only 7 lines. But it is showing error in the eight line saying ';' is missing. and in 2nd line it is showing some character is missing.
And when we Run the Shell script in the OMVS, it is showing MALLOC cannot be more than some limit.
Still doing some RnD :-).
Do u have any idea on this ??? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I'm not a Java programmer so I don't have a clue about the missing ';' or other missing character. I've got a Hello World java script I use for testing new releases but that's about as far as my Java goes.
As far as the MALLOC cannot be more than some limit: there are a number of memory-related parameters in member BPXPRM?? of your SYS1.PARMLIB and some of these parameters cannot be left at the IBM default if you're using Java. You'll need to contact a systems programmer at your site to verify what the values are and have them changed for Java.
On the plus side, it sounds like your original issue is resolved. |
|
Back to top |
|
|
sriram.mukundan
New User
Joined: 20 Nov 2007 Posts: 28 Location: chennai
|
|
|
|
Thanks Robert .!!!
Helping me in the correct moment.
Thanks!!! |
|
Back to top |
|
|
shivaganeshaa
New User
Joined: 11 Aug 2005 Posts: 14 Location: chennai
|
|
|
|
Hi,
I have sample java program. Can you tell me whr should be the JAR files be placed. If i keep them in USS directory path, will it be ready to run ?
And how should i bring the JAR files in to USS. |
|
Back to top |
|
|
|