EN
Back to the archive

The encyclopedia · Software & IT · Technical decision · 1995–1996

Java's bytecode and 'write once, run anywhere' made it the portable standard

Sun compiled Java to a portable bytecode run on a per-platform JVM, so one program ran anywhere; the design became the cross-platform language.

Sun Microsystems · Oracle

the move

In the 1990s a program had to be recompiled for each operating system and processor, and portability was slow and costly.

Sun's Java compiled to a portable bytecode instead of native code, and each platform shipped a virtual machine that executed it.

Sun gave away the SDK and promoted the 'write once, run anywhere' idea, so a single program could run on many devices.

why it works

  • A single bytecode meant the app was written once and ran on any platform with a JVM.
  • Putting the virtual machine on each platform concentrated porting effort in one well-defined place.
  • Giving the SDK away removed the cost that would have blocked wide adoption.
  • The bytecode's long-term compatibility let code outlive the hardware it was written for.
the payoffCompile to a bytecode, run on a portable engineclever

what transfers

To beat per-platform rewrites, standardize the intermediate format and make porting the runtime everyone's job.

what came after

Java became one of the most widely used languages; its bytecode and JVM kept a huge server, Android and enterprise codebase portable, and the approach influenced later runtimes.

references

spotted an error? The archive wants to know.

same kind of clever