Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Compilation of Java program can be done in Mainframes ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: Compilation of Java program can be done in Mainframes ?
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: 7905
Location: Bellevue, IA

PostPosted: Tue Jul 01, 2008 10:59 pm    Post subject:
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    Post subject:
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    Post subject:
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: 7905
Location: Bellevue, IA

PostPosted: Wed Jul 02, 2008 12:14 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Jul 02, 2008 8:10 am    Post subject:
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: 7905
Location: Bellevue, IA

PostPosted: Wed Jul 02, 2008 4:58 pm    Post subject:
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    Post subject:
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: 7905
Location: Bellevue, IA

PostPosted: Wed Jul 02, 2008 8:59 pm    Post subject:
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    Post subject:
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: 7905
Location: Bellevue, IA

PostPosted: Wed Jul 02, 2008 10:13 pm    Post subject:
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    Post subject:
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: 7905
Location: Bellevue, IA

PostPosted: Thu Jul 03, 2008 4:52 pm    Post subject:
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    Post subject:
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: 7905
Location: Bellevue, IA

PostPosted: Thu Jul 03, 2008 5:50 pm    Post subject:
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    Post subject:
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    Post subject: sample Java Program
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts Need points to tune IMS Checkpoint Pr... satish.ms10 IMS DB/DC 2 Fri Sep 30, 2016 4:12 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us