Java 11 allows you to execute single file source code programs without a separate compilation step. So, given HelloWorld.java you can run it from the source file with:
java HelloWorld.java
This works fine on z/OS.
Java 11 also allows you to run a Java program as a script with a shebang, e.g. HelloWorld (without .java extension):
#!/usr/lpp/java/J11.0_64/bin/java --source 11
class HelloWorld
{
public static void main(String args[])
{
System.out.println("Hello World");
}
}
Should run with the command
./HelloWorld
This doesn't seem to work on z/OS. I get the message:
error: no filename
Does anyone have this working on z/OS? Any ideas what I might be doing wrong? I tried with a UTF8 file instead of EBCDIC, but that seemed to be further from working (I don't think the shebang was recognized for UTF8).
Thanks
Andrew Rowley
------------------------------
Andrew Rowley
------------------------------