Any language or software needs a runtime environment. Just as people want to live in the air and fish want to live in the water, shade-loving plants cannot be exposed to sunlight, and any individual object cannot exist without its environment, so programming languages are no different.

What are the differences between JDK, JRE, and JVM in Java? I also found a set of related video, you can refer to it, if the text can not watch, you can also directly poke video understanding >>>

What are the concepts of JDK, JRE, and JVM in Java? What’s the difference?

The JDK is a Java language software development kit, mainly used for Java applications on mobile devices and embedded devices. JDK is the core of the whole Java development, it contains the Java runtime environment (JVM+Java system class library) and Java tools.

The Java Runtime Environment (JRE) is a piece of software developed by Sun Microsystems. The JRE enables a computer system to run Java applications. The JRE contains a Java Virtual Machine (JVM) and some standard Class libraries.

The JVM, short for Java Virtual Machine, is a specification for computing devices. The JVM is an imaginary computer that is implemented by emulating various computer functions on an actual computer. The Java language uses the Java Virtual machine to mask platform-specific information, allowing Java language compilers to run unmodified on multiple platforms by generating object code (bytecode) that runs on the Java Virtual machine.

In simple terms

  • JDK=JRE+ various Java development tools
  • JRE=JVM+ various class libraries

What is the relationship between the JDK, JRE, and JVM in Java? What’s the connection?

The development and running of Java language can not be separated from the running environment of Java language JRE. The Java language cannot run without JRE support. Of course, if you want to compile Java programs and do minor development, the JRE is obviously not enough, so you need the JDK.

Actually, the JDK is the JRE plus some common tools. The JDK can not only run already compiled Java programs, but also enable us to compile Java programs (JDK=JER+ various tools).

Advice:

  • If you want to run a Java program or a Java game like Minecraft, all you need is a JRE, which is usually very small and includes a JVM
  • If you want to develop Java programs, you need to install the JDK

The relationship between the three is a nested relationship: JDK>JRE>JVM!!

Today mainly to share these to everyone, have other opinions and ideas of friends can leave a message to discuss oh, we study together, progress together!