What java lacks in speed, it makes up for with its ability to go cross-platform without having to recompile or port code. A java program written on a windows box will run on a linux box and macintosh, etc as long as they have the java virtual machine.
The source code you write is turned into byte code for the JVM. Then the java interpreter translates the byte code into machine code on the fly.