Javascript is a scripted programming language which is predominantly client-side (everything runs in your browser).
Java is a compiled programming language used in a lot of commercial software, and generally runs on the server.
In the case of chat room, you could think that a Java-based chat would run similarly to a Flash-based chat -- all of the software actually lives on our servers, but your browser will download a little bit of the software (like a .SWF) to run the chat.
Given the advances of Javascript, we *could*, in theory, make a Javascript-based chat that was all run in the browser, which is how Facebook does their instant message chat, but we'd rather use a commercial system that has been tested and so on, instead of building our own.