I just had to respond to this
JAVA WORKS RIGHT OUT OF THE BOX ON OSX, AND IT COMPILES RIGHT OUT OF THE BOX TOO.
Use the text editor of your choice and save as a plain text document with a .java extension. Go to the terminal and switch to the directory containing your file and type javac and the filename, if you made no mistakes it just works. I find the VI editor built into the terminal to be fastest and most suited to editing java, php, html, javascript etc. If you want to complie and edit java in 9.22 you have to supply your own compiiler and I think you have to use the applet runner, I do not know how to test java applications in 9, perhaps Codewarrior is useful for that.
But if you are teaching this, the best approach would be to use 10.2 and compile and launch from the terminal using vi, it's native, free and it's what unix pros use on other operating systems, 9.2 is less suited to efficient java programming programming, though windows is the worst especially XP .
Any other question, I can try to answer from my limited experience.
Mark