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

Compilation of Java program can be done in Mainframes ?


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sriram.mukundan

New User


Joined: 20 Nov 2007
Posts: 28
Location: chennai

PostPosted: Tue Jul 01, 2008 10:16 pm
Reply with quote

Hi Guys,

Can you Please tell me whether we can compile/Run Java application in Host ??

Please Let me know.
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: Tue Jul 01, 2008 10:59 pm
Reply with quote

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

New User


Joined: 20 Nov 2007
Posts: 28
Location: chennai

PostPosted: Tue Jul 01, 2008 11:09 pm
Reply with quote

Thanks!!!

How to Check whether Java VM is there in My system ?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jul 01, 2008 11:11 pm
Reply with quote

sriram.mukundan wrote:
Thanks!!!

How to Check whether Java VM is there in My system ?


ASK!
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 Jul 02, 2008 12:14 am
Reply with quote

Code:
//BPXBATCH EXEC PGM=BPXBATCH,
//         PARM='sh java -version',
//         REGION=0M
//STDOUT   DD   SYSOUT=*
//STDERR   DD   SYSOUT=*
Back to top
View user's profile Send private message
sriram.mukundan

New User


Joined: 20 Nov 2007
Posts: 28
Location: chennai

PostPosted: Wed Jul 02, 2008 8:01 am
Reply with quote

thank u!!!

Robert if u don mind can u tell me in detail. pls.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Jul 02, 2008 8:10 am
Reply with quote

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

Global Moderator


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

PostPosted: Wed Jul 02, 2008 4:58 pm
Reply with quote

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

New User


Joined: 20 Nov 2007
Posts: 28
Location: chennai

PostPosted: Wed Jul 02, 2008 8:53 pm
Reply with quote

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

Global Moderator


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

PostPosted: Wed Jul 02, 2008 8:59 pm
Reply with quote

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

New User


Joined: 20 Nov 2007
Posts: 28
Location: chennai

PostPosted: Wed Jul 02, 2008 9:44 pm
Reply with quote

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

Global Moderator


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

PostPosted: Wed Jul 02, 2008 10:13 pm
Reply with quote

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

New User


Joined: 20 Nov 2007
Posts: 28
Location: chennai

PostPosted: Thu Jul 03, 2008 9:58 am
Reply with quote

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

Global Moderator


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

PostPosted: Thu Jul 03, 2008 4:52 pm
Reply with quote

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

New User


Joined: 20 Nov 2007
Posts: 28
Location: chennai

PostPosted: Thu Jul 03, 2008 5:35 pm
Reply with quote

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

Global Moderator


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

PostPosted: Thu Jul 03, 2008 5:50 pm
Reply with quote

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

New User


Joined: 20 Nov 2007
Posts: 28
Location: chennai

PostPosted: Fri Jul 04, 2008 4:33 pm
Reply with quote

Thanks Robert .!!!

Helping me in the correct moment.

Thanks!!!
Back to top
View user's profile Send private message
shivaganeshaa

New User


Joined: 11 Aug 2005
Posts: 14
Location: chennai

PostPosted: Mon Mar 28, 2011 11:01 pm
Reply with quote

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
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Error to invoke MPP program through B... IMS DB/DC 3
No new posts NAK is getting added FTP from Mainframes JCL & VSAM 6
No new posts Using API Gateway from CICS program CICS 0
No new posts SH256/MD5 Checksum in Mainframes JCL JCL & VSAM 14
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
Search our Forums:

Back to Top