Solaris 8 (5.8) is the official build platform for Java 5 (32-bit)
When going for Java 5 you will have to register with SUN/Oracle first
because the product already announced its End of Service Life (EOSL).
If you do so, you will get a link for download and also should receive
a list of Solaris patches required (if any).
On top of that, the package manager or shell script used for installation
will check for them patches.
Java 6, just download and install.
Hope that helps
Matt