Platform Independence

Porting an application to a new platform can be traumatic. User interface, graphics, multi-threading, synchronization, and I/O are all platform dependent. These services may constitute over half of the application code and will need to be modified for the port.

Java advanced the cause of platform independence by defining three virtual platforms:

J2SE = virtual desktop platform
J2EE = virtual server platform
J2ME = virtual PDA platform

Each platform contains class libraries and a virtual machine.

Programmers can develop applications on top of a virtual platform. Their customers can install a platform-dependent implementation of the virtual platform and run the application. The application does not need to be modified. Hence the Java slogan: Write once, run everywhere.

The J2SE Platform

The J2SE Platform consists of the implementation plus the Java Development Kit (JDK). The JDK consists of the Java Runtime Environment (JRE) plus development tools such as the Java to Bytecode compiler (javac).

The JRE consists of the Java virtual machine (JVM), which is a Bytecode interpreter, plus the Java class libraries. The Java class libraries are divided into application programmer interfaces (APIs). The APIs are divided into packages and sub-packages.

The APIs are graphically summarized at: