JAVA on mainframes.

C/C++ and Java for MVS & zOS.
Post Reply
User avatar
CountryDelight
Registered Member
Posts: 12
Joined: Sun Aug 08, 2021 4:19 pm

JAVA on mainframes.

Post by CountryDelight »

Hi,

Could you please guide on how can I start building 'Hello World' program of JAVA on mainframes? And how do we know if that's allowed on our mainframes?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: JAVA on mainframes.

Post by Robert Sample »

Contact your site support group for assistance. In order to access Java on the mainframe, your TSO user id must have an OMVS segment defined in RACF. If you don't have an OMVS segment, you won't be using Java on the mainframe -- period. This is usually added by either the security group or the system programming group, depending upon the site. Some sites automatically add it for every TSO user but many do not add it until it is needed. As to whether or not it is allowed on your mainframe, you MUST contact someone at your site to find out. Java has been a part of z/OS for a number of years, so the question is not whether or not your site has java (unless you are running a very old version of the operating system), the question will be does your site let you use it?

Once you have an OMVS segment, you can go to OMVS (which is the Unix shell for z/OS) -- or you may be able to use Telnet to connect to your mainframe port 23 (or whatever your site uses) from your PC. You can use an ISPF-like editor to create your Java program as a file in your user directory. Then you type in java <program file name> in OMVS and it will compile / execute your program. OMVS, like Unix in general, is case-sensitive so you'll need to ensure the file name is the same each time you use it.
User avatar
CountryDelight
Registered Member
Posts: 12
Joined: Sun Aug 08, 2021 4:19 pm

Re: JAVA on mainframes.

Post by CountryDelight »

I tried 'TSO OMVS' after logging-in and get the following:

Code: Select all

IBM                                                                                                                                 
Licensed Material - Property of IBM                                                                                                 
5650-ZOS Copyright IBM Corp. 1993, 2017                                                                                             
(C) Copyright Mortice Kern Systems, Inc., 1985, 1996.                                                                               
(C) Copyright Software Development Group, University of Waterloo, 1989.                                                             
                                                                                                                                    
U.S. Government Users Restricted Rights -                                                                                           
Use,duplication or disclosure restricted by                                                                                         
GSA ADP Schedule Contract with IBM Corp.                                                                                            
                                                                                                                                    
IBM is a registered trademark of the IBM Corp.                                                                                      
                                                                                                                                    
FSUM2384 No session was started.  The system cannot set the current working directory to the specified home directory for this user 
ID.                                                                                                                                 
                                                                                                                                    
Function = chdir(), directory name = '/u/tsoid1', return value = -1, errno = 129 (X'00000081'), reason code = 05190050, message = 'E
DC5129I No such file or directory.'                                                                                                 
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
 	>>>> 	FSUM2331 The session has ended.  Press <Enter> to end OMVS.                                                                   
                                                                                                        	                      INPUT 
ESC=      1=Help      2=SubCmd    3=HlpRetrn  4=Top       5=Bottom    6=TSO       7=BackScr   8=Scroll    9=NextSess 10=Refresh     
         11=         12=
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: JAVA on mainframes.

Post by Robert Sample »

There are several key pieces of information defined in the OMVS segment of RACF -- the shell to use, the uid and gid (UNIX userid and groupid), and the home directory for the user. The message you are getting indicates that the home directory for your user id does not exist. The system is attempting to connect you to /u/tsoid1 and failing to do so. Most likely the problem is that directory /tsoid1 does not exist under directory /u, although it is possible that /u doesn't exist either. If you are not using tsoid1 as your logon id to TSO, then that would also be an issue. Talk to your site support group and they should be able to straighten out the access. If you had appropriate UNIX permissions, you could go to ISPF 3.17 and look at the /u directory, and possibly add /tsoid1 under it -- but it is unlikely that anyone other than a system programmer has that level of access.
User avatar
CountryDelight
Registered Member
Posts: 12
Joined: Sun Aug 08, 2021 4:19 pm

Re: JAVA on mainframes.

Post by CountryDelight »

Thanks Robert. I'll get in touch with support and see what happens.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “C, C++ and Java for Mainframes.”