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?
JAVA on mainframes.
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: JAVA on mainframes.
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.
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.
- CountryDelight
- Registered Member
- Posts: 12
- Joined: Sun Aug 08, 2021 4:19 pm
Re: JAVA on mainframes.
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=
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: JAVA on mainframes.
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.
- CountryDelight
- Registered Member
- Posts: 12
- Joined: Sun Aug 08, 2021 4:19 pm
- myoggradio
- Registered Member
- Posts: 15
- Joined: Tue Jul 30, 2024 8:15 pm
Re: JAVA on mainframes.
Wenn denn das OMVS Segment da ist, kann man mittels des Befehls "java -version" im Open MVS erstmal prüfen, ob Java überhaupt installiert ist.
Falls dies der Fall ist, möchte ich bemerken, das Java Bytecode System unabhängig ist. Klar gibt es Ausnahmen, so ist z.B.: kein grafische Oberfläche (Swing, JavaFX) unter z/OS möglich.
Man kann also auf dem PC entwickeln und die erstellten jar Files auf dem Großrechner laufen lassen.
Zusätzlich gibt es unter z/OS das JZOS, das spezielle Bibliotheken für z/OS bereitstellt.
Und mit dessen Hilfe kann man Java als Batch Job oder sogar als Started Task laufen lassen.
Man kann Java sogar im CICS laufen lassen. Hier gibt es die JCICS Bibliothek.
Dann gibt es sogar einen Applikation Server unter z/OS. Aber damit kenne ich mich nicht mit aus.
Gruß Christian
Falls dies der Fall ist, möchte ich bemerken, das Java Bytecode System unabhängig ist. Klar gibt es Ausnahmen, so ist z.B.: kein grafische Oberfläche (Swing, JavaFX) unter z/OS möglich.
Man kann also auf dem PC entwickeln und die erstellten jar Files auf dem Großrechner laufen lassen.
Zusätzlich gibt es unter z/OS das JZOS, das spezielle Bibliotheken für z/OS bereitstellt.
Und mit dessen Hilfe kann man Java als Batch Job oder sogar als Started Task laufen lassen.
Man kann Java sogar im CICS laufen lassen. Hier gibt es die JCICS Bibliothek.
Dann gibt es sogar einen Applikation Server unter z/OS. Aber damit kenne ich mich nicht mit aus.
Gruß Christian