JZOS is great but here's a IVP job using OSHELL I run to exercise the HelloWorld program supplied in the java bin directory. To write your own no doubt there's a source example out there that you can compile (javac) and run.
//TSO EXEC PGM=IKJEFT1B,DYNAMNBR=50,REGION=0M //SYSPROC DD DISP=SHR,DSN=SYS1.SBPXEXEC //STDENV DD * JAVADIR=/usr/lpp/java/J7.0 //SYSTSIN DD * oshell + PATH=$JAVADIR/bin:$PATH && + echo path=$PATH && + java -version oshell + PATH=$JAVADIR/bin:$PATH && + java -classpath $JAVADIR HelloWorld //SYSTSPRT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY // Output: path=/usr/lpp/java/J7.0/bin:/bin:/usr/lpp/java/J5.0_64/bin:. java version "1.7.0" Java(TM) SE Runtime Environment (build pmz3170sr9fp50-20160720_02(SR9fp50)) IBM J9 VM (build 2.6, JRE 1.7.0 z/OS s390-31 20160630_309948 (JIT enabled, AOT enabled) J9VM - R26_Java726_SR9_20160630_1817_B309948 JIT - tr.r11_20160630_120374 GC - R26_Java726_SR9_20160630_1817_B309948 J9CL - 20160630_309948) JCL - 20160719_01 based on Oracle jdk7u111-b13 Hello World On Mon, Jun 5, 2017 at 9:57 PM, John McKown <john.archie.mck...@gmail.com> wrote: > On Mon, Jun 5, 2017 at 7:44 PM, Charles Mills <charl...@mcn.org> wrote: > > > Remember @Steve Beaver's question "where do I find a C++ sample for > z/OS?" > > Well, this is my variant of that question. > > > > If I wanted to write "Hello, World" in Java such that it would run in > batch > > on z/OS, where would I start? Where is the "Programmers' Guide" for Java? > > > > I know OO concepts, I'm an experienced C++ programmer, and I took a Java > > class once upon a time. I can find Java language and class references on > > the > > Web. I'm not looking for that. I'm looking for how to get from > > System.out.println("Hello World"); to //JAVAPGM EXEC PGM=HELLOW ? > > > > Charles > > > > > The magic word in this case is JZOS. This is the Java batch launcher for > z/OS, which come bundled with the Java JDK. > https://www.ibm.com/support/knowledgecenter/en/SSYKE2_8.0. > 0/com.ibm.java.zsecurity.80.doc/zsecurity-component/jzos.html > > The above page has links to the information you need. > > As an aside, JZOS was originally written by Dovetailed Technologies (the > authors of the excellent Co:Z package). It was so much better than anything > IBM had that IBM now distributes it with the JDK. I don't know if IBM > bought it or has an exclusive license to distribute. > > If you're going to do any UNIX work in batch, go here: > http://dovetail.com/products/cozbatch.html and get this package. It does > not require _any_ special authorities so you could even install it using > your TSO high level qualifier for the data sets and your UNIX ${HOME} for > the UNIX files. Once you've tried this, you'll sneer at IBM's pathetic > BPXBATCH. Oh, and the run-time license is a very affordable -- FREE!!!! You > don't even have to register your email or _anything_. Not even a thank you > note. > > > -- > Windows. A funny name for a operating system that doesn't let you see > anything. > > Maranatha! <>< > John McKown > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN