Running z/OS140.
When i need to compile i used BPXBATCH as follow :
//JCOMP EXEC PGM=BPXBATCH,
// PARM='sh javac -d /u/einsarg/testjava/classes
// /u/einsarg/testjava/src/sample01.java'
Can i do the same with JZOS....?
I tried the following, but doesn't work as i guess JZOS cannot execute shell commands :
//JAVA EXEC PROC=JVMPRC14,
// JAVACLS='javac'
//STDENV DD *
. /etc/profile
//MAINARGS DD *
-d /u/einsarg/testjava/classes
/u/einsarg/testjava/src/sample01.java'
Java compiling with JZOS
JZOS can run java classes. The javac shell command is actually a way to launch java and run the "com.sun.tools.javac.Main" class. So you should be able to do compiles by using this as the class name.
Perhaps a better option would be to run Ant under JZOS and use the javac Ant task to do your compiles.
BTW - most people rarely if ever compile java on z/OS. It is much easier to compile on your workstation (say, under an IDE like Eclipse), package up jars and upload those jars to z/OS for execution. See the BatchSample project on the downloads page for a complete example, including Ant scripts that build and upload/deploy to z/OS.
Perhaps a better option would be to run Ant under JZOS and use the javac Ant task to do your compiles.
BTW - most people rarely if ever compile java on z/OS. It is much easier to compile on your workstation (say, under an IDE like Eclipse), package up jars and upload those jars to z/OS for execution. See the BatchSample project on the downloads page for a complete example, including Ant scripts that build and upload/deploy to z/OS.
-
- Posts: 3
- Joined: Tue Oct 03, 2006 2:49 am
hello,
Thanks for your answer.
I tried the following :
//JAVA EXEC PROC=JVMPRC14,
// JAVACLS='com.sun.tools.javac.Main'
//STDENV DD *
. /etc/profile
//MAINARGS DD *
'-d /u/einsarg/testjava/classes /u/einsarg/testjava/src/sample01.java'
and got :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM z/OS Persistent Reusable VM build
JVMJZBL1027I Using output encoding: IBM-1047
JVMJZBL1016I MVS commands are ENABLED
JVMJZBL1023N Invoking com.sun.tools.javac.Main.main()...
JVMJZBL2008E Could not find or load class: com.sun.tools.javac.Main
JVMJZBL2007E Stack trace follows:
java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
Where is com.sun.tools.javac.Main class located...?
Thanks for your answer.
I tried the following :
//JAVA EXEC PROC=JVMPRC14,
// JAVACLS='com.sun.tools.javac.Main'
//STDENV DD *
. /etc/profile
//MAINARGS DD *
'-d /u/einsarg/testjava/classes /u/einsarg/testjava/src/sample01.java'
and got :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM z/OS Persistent Reusable VM build
JVMJZBL1027I Using output encoding: IBM-1047
JVMJZBL1016I MVS commands are ENABLED
JVMJZBL1023N Invoking com.sun.tools.javac.Main.main()...
JVMJZBL2008E Could not find or load class: com.sun.tools.javac.Main
JVMJZBL2007E Stack trace follows:
java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
Where is com.sun.tools.javac.Main class located...?
-
- Posts: 3
- Joined: Tue Oct 03, 2006 2:49 am