What Is a Runtime Environment?
A runtime environment is the software a program needs around it while it runs: the engine that executes its code, the standard libraries it calls, and the services that manage memory, errors and access to the operating system. The JVM, Node.js and CPython are examples.
Updated September 24, 2026
Run console.log(typeof process) in Node.js and it prints object. Paste the same line into the console of Chrome and it prints undefined. The language is the same JavaScript in both places, but the program is running inside two different runtime environments, and each one gives it different tools.
console.log(typeof process); // "object" in Node.js, "undefined" in a browser
console.log(typeof document); // "undefined" in Node.js, "object" in a browser
What a runtime environment provides
Your code only describes what to do. When it runs, it leans on a layer of software that was installed before you wrote a line. That layer usually has five parts:
- An execution engine. Something has to run the code: an interpreter, a virtual machine, or a just-in-time compiler. CPython, the Java Virtual Machine (JVM) and V8 are execution engines.
- A standard library. Ready-made functions for text, math, dates, files and networking, such as Python's
jsonmodule or Java'sjava.utilpackage. - Memory management. The runtime allocates memory for your objects and, in Python, Java and JavaScript, frees it again with a garbage collector when nothing uses it.
- Error handling. When something goes wrong, the runtime stops the program in a controlled way and reports where, as a traceback or stack trace.
- Access to the operating system. Reading files, opening network connections, reading environment variables and command-line arguments all go through the runtime, which asks the operating system on your program's behalf.
You can ask the Python runtime about itself:
The answers depend on where the code runs. On a Linux server platform.system() returns 'Linux', on a Mac 'Darwin', and on Windows 'Windows'. The recursion limit (1000 by default in CPython) is a rule set by the runtime, not by the Python language, and the dozens of modules already loaded before your first line are the runtime preparing itself.
Java: JDK vs JRE vs JVM
Java makes the layers visible because each one has its own name:
| Name | Stands for | What it contains | Who needs it |
|---|---|---|---|
| JVM | Java Virtual Machine | The engine that runs bytecode (.class files) and manages memory | Part of both below |
| JRE | Java Runtime Environment | The JVM plus the standard class libraries | People who only run Java programs |
| JDK | Java Development Kit | The JRE plus developer tools: javac, jar, javadoc, jdb | People who write Java programs |
The flow is: javac Main.java (a JDK tool, the compiler) turns source code into Main.class, and java Main starts the JVM, which loads the class and runs it with the libraries of the runtime environment. The JVM is the reason one .class file runs on Windows, macOS and Linux: each operating system has its own JVM, and they all understand the same bytecode.
Since Java 11, Oracle ships only the JDK and no separate JRE download. Some distributions, such as Eclipse Temurin, still publish a JRE package. If you are learning Java, install a JDK: it contains everything the JRE does. The install Java guide walks through it.
JavaScript: the browser and Node.js
JavaScript was designed to run inside web pages, so its first runtime environment was the browser. A browser runtime gives your code the document of the page, window, timers, and fetch for network requests, and it deliberately blocks direct access to your files.
Node.js takes Google's V8 engine out of the browser and wraps it in a different runtime: no document, but modules such as fs for files, http for servers, and the process object for environment variables and arguments. Deno and Bun are newer runtimes for the same language with their own tools. All of them run the same core JavaScript; the difference is what surrounds it. The Node.js runtime and event loop pages go further.
Python: CPython and friends
When people say "install Python" they mean install a runtime environment: the CPython interpreter, the standard library, and pip for adding packages. Other runtimes exist for the same language. PyPy adds a JIT compiler for speed, and MicroPython is small enough to run on microcontrollers.
A virtual environment (python3 -m venv .venv) is not a new runtime. It points at an existing interpreter and gives one project its own set of installed packages, so two projects can use different versions of the same library. See virtual environments.
Compile time and run time
"Runtime" also names a moment: the period while the program is running, as opposed to compile time, when the source is being translated. A mistake the compiler rejects is a compile-time error; one that only appears while the program runs, such as dividing by zero, is a runtime error. The runtime environment is the software present during that second period.
Even C, which compiles straight to machine code, has a small runtime. A C program starts in startup code supplied by the compiler toolchain, and functions such as printf and malloc come from the C standard library (glibc on most Linux systems, the Universal C Runtime on Windows). There is simply no virtual machine and no garbage collector.
Common misconceptions
- "The runtime environment is the operating system." The operating system manages the hardware for every program. The runtime environment is one program's layer on top of it. The JVM is itself a program that Windows, macOS or Linux runs; it does not replace them.
- "Node.js is a language or a framework." Node.js is a runtime environment for JavaScript. Frameworks such as Express are libraries that run inside it.
- "Installing an IDE installs the runtime." VS Code does not include Python or Java. The editor and the runtime environment are separate installs, although some IDEs, such as IntelliJ IDEA, can download a JDK for you.
- "Same language, same behavior everywhere." Features the runtime provides, such as file access, default limits and available modules, can differ. Code that runs in Node.js can fail in a browser for exactly that reason.
Where to go next
The execution engine inside most runtimes is an interpreter, and that page also compares it with a compiler. Underneath every runtime sits the operating system. To practice in a runtime you have not used yet, start the Java course or the JavaScript course.
Frequently Asked Questions
Can you give me an example of a runtime environment?
Is Node.js a runtime environment?
What does runtime actually mean?
Should I install the JRE or the JDK?
javac and everything in the JRE. The JRE alone only runs existing Java programs. Since Java 11, Oracle distributes only the JDK, so for current Java versions the JDK is the normal choice.What do JDK, JRE and JVM stand for?
javac.