JVM vs CLR
Both run code that was first turned into an in-between form. The JVM runs bytecode made from Java and Kotlin. The CLR runs CIL made from C# and F#.
Java Virtual Machine (JVM)
The runtime that runs Java bytecode. It works on any machine that has one.
The Java Virtual Machine, or JVM, is the runtime that runs Java programs. The Java compiler turns code into bytecode, kept in .class files. The JVM runs that bytecode on any computer that has a JVM. It turns busy code into machine code as it runs. It also cleans up memory for you. Kotlin, Scala and Clojure make bytecode for the JVM too.
Common Language Runtime (CLR)
The .NET runtime. It runs C#, F# and Visual Basic code as one kind of code.
The Common Language Runtime, or CLR, is the runtime that runs .NET programs. Tools for C#, F# and Visual Basic turn code into an in-between code called CIL. When the program runs, the CLR turns CIL into machine code, just in time. It also cleans up memory with garbage collection. Code run this way is called managed code.
In one line
- Java Virtual Machine (JVM)
- The runtime that runs Java bytecode. It works on any machine that has one.
- Common Language Runtime (CLR)
- The .NET runtime. It runs C#, F# and Visual Basic code as one kind of code.