Java source code is compiled into bytecode, and the bytecode is interpreted by a platform specific JVM. The same bytecode will be generated no matter what platform you're on. This is why Java applets became so popular when the World Wide Web was new because you could create your Java .class on the host, and then the client assuming they had a JVM compatible with the .class file would download the .class file of the applet and interpret it.
Originally posted by ashley kumar: Why java bytecodes are interpreted, not compiled? Please explain me.
With all the latest JVMs, that support hotspot technology, the java bytecodes are both interpreted and compiled. The compilation is for future calls to the method. In fact, I believe that methods will be recompiled with higher optimization, if it is deemed as a "hotspot".