It is a scripting language, and one that is interpretted at runtime by the browser, a lot of the code can be the same these days between IE6 and Mozilla, but there is still differences that you have to program towards. Again, Russ has done an excellent job at making RHP cross browser friendly.
Now Java on the other hand is a full fledged programming language/platform. It is in use today in a wide variety of implementations ranging from Web Server Backend code in the form of JSP to Java Applets (though you don't see them very often anymore) on the browser, to stand alone applications.
It requires the installation of a Java Virtual Machine (JVM). When you make a Java program and compile it, it compiles it to an iintermediate step called "bytecode". This is then interpretted on each machine by the local JVM and the code is run.
This does two things, makes the code "write once, run anywhere" (almost) and also can be slower in some cases.
I do the majority of my programming now in C# in ASP.Net. This is Microsofts system that implements a very similar architecture as Java. A Virtual Machine (.Net Framework), intermediate code(MSIL), similar structure.