Write Once and Run Anywhere

One of the initial "killer feature" of Java was supposed to be the write once, run anywhere nature of it. Earlier, it is not practically possible to have different versions of an application for different devices because the devices have variety of CPUs, operating system and browsers. The same code must work on all the computers, therefore we need a portable code . Portability refers to the ability to run a program on different machines. "Java is portable" , means that you can run Java bytecode on any hardware that has a compliant JVM (Java Virtual Machine). The Java Compiler compiles a java program (.java file) and converts it into class files (.class) that contain bytecodes , which is the intermediate language between source code and machine code . These bytecodes are not platform specific, so with the help of JVM (Java virtual machine), the java program can run on wide variety of platforms. The JVM (Java virtual machine) is platform dependent i.e its implementation differs from platform to platform (like windows, linux atc.), but these all JVMs can execute the same java bytecode . This is something which can be termed as 'write once and run anywhere' . So, this means Java can be developed on any device, compiled into a standard bytecode and be expected to run on any device equipped with a JVM (Java virtual machine). More about... Java Virtual Machine