Ubuntu bundles a great application, Synaptic Package Manager, which makes an excellent job to manage the dependencies, installation and desinstallation of applications of any kind in the Ubuntu platform. This usually works for all the platforms supported by Ubuntu, including the PowerPC architecture, which is the one that concerns my good old G3 iBook.
As I said, it usually works. Particularly for Java, the installation via Synaptic Package Manager does not work, since Sun does not provide Java, in any version, for the Linux/PowerPC platform (there is a Java version for Linux, but it targets the x86 architecture). And since Java is not an open source project (yet), it becomes harder to know what to do.
So this is where this page comes in: it provides all the information needed to install Java in a PowerPC-based Mac, from the 603 to the G5. It even provides the instructions to configure Firefox, Mozilla and Opera to use your newly installed Java installation properly!