(Originally posted 2009-04-25.)
In this post (and any others in a similar vein) I'm going to be displaying a great deal of ignorance – but I think I'm doing it in a good cause.
I know a fair amount about things like Java, XML and C++ – but NOT on z/OS. So I'm determined to learn and present what I learn as "For Beginners" posts here.
The idea is that I'll encourage other people with more traditional z/OS skills to try some simple new things, such as java. So, if you've not done these things before do have a go. Stuff is remarkably straightforward to do.
Here's how I created a simple "Hello World" java application in Unix System Services.
- Log onto TSO with a region of 64MB (64000 in the logon panel). When I tried this with 32000 I got a "JVMDBG001" message, complaining of not being able to GETMAIN enough memory to start the JVM (but the JVM started anyway).
- Type OMVS. (If your userid has been set up to use Unix System Services it should start you in a directory (mine being "/u/userid").
- Create a subdirectory using "mkdir javatest".
- Change to this subdirectory using "cd javatest".
- List what's in this subdirectory (actually nothing) using "ls".
- Create a new java source file using "oedit Hello.java".
-
While in the (ISPF) Editor add the following lines:
public class Hello{ public static void main(String args[]){ System.out.println("Welcome!"); } }
- Press PF3 to save. (Treat the resulting dialog as any "leaving ISPF" dialog.)
- Compile the resulting java with "javac Hello.java".
- Run the compiled java bytecode with "java Hello".
And that's all there is to it. One note – if you're not familiar with java: Case is significant. Mismatches would cause problems.
The java book I used to get started (and then some) was Deitel & Deitel's "Java How To Program" but there are lots of them to choose from.
If you're more experienced at this than me please feel free to comment as you see fit. But remember this is a "For Beginners" post. I'm trying to encourage people to GET STARTED.