It all comes standard.
java, javac and all of the rest of the debug tools, dev tools and libraries come standard with Apple's Developer Tools. java (the JVM and runtime environment, that is) comes standard on ALL OS X systems.
To get the Apple Dev Tools, go to developer.apple.com. You'll need to sign up for a developer ID. Once you log in, you can download the latest tools or send away for them.
The way the dev tools installs is not the same as on Windows or Linux or Solaris. All of the executables are located in /usr/bin (so you'll have to provide Java IDE's and tools with /usr for the JAVA_HOME variable or home directory of your JDK). Also, all of the libraries are located under a system toolkit. They are either in /Library or /System/Library (I can't remember, sorry).
Other than that, every pure Java program I've tried under OS X works flawlessly. (And compiles flawlessly, too) I've got Java stuff for work compiling and running on my Macs. I've even got Java working with Mathematica via JLink on my laptop. I use it to get to my MySQL database on my server machine. Pretty flippin' sweet to get data into Mathematica via Java.
Hope this answers the question you were asking.
Taft