

IDGįigure 1. The Java Runtime Environment spawns a JVM. The Java Runtime Environment spawns a JVM, which is a software layer that runs on top of a computer's operating system, providing additional services specific to Java. Each layer provides services that will be used (and required) by the layers above it. We can look at software as a series of layers that sit on top of the system hardware. Today, it's been adopted as a norm for many software systems, including JavaScript and Python.

When it was first introduced, Java's "write once, run anywhere" principle was considered revolutionary. The JRE loads class files and starts a virtual machine (the JVM) that ensures there is access to memory and other system resources in a consistent form across many operating systems. In the case of Java and other JVM-based languages, the JRE creates an intermediary between the operating system and the actual program.

The Java Runtime Environment changed all that, at least for Java programs. The program ran inside whatever computer it was on and relied directly on operating system settings for resource access resources like memory, disk access, and network access. In the past, most software used the operating system (OS) as the runtime environment. What is a runtime environment?Ī software program needs to execute, and to do that, it needs an environment to run in. Defaults work well for most implementations, especially when you're starting out with Java. You also can download the JRE separately from the JDK, and you may choose from a variety of JVMs. We'll dig a lot deeper into how these components work together in the discussion that follows.įrom an installation perspective, anytime you download a JDK, it will include a version-compatible JRE, and that JRE will include a default JVM.
