About the difference between JRE and JDK

JDK: A development kit for developing java programs, which includes java compiler, JVM, a large number of java tools, java class library , and java language specification . JDK is only a development environment. For example, when you write code to use its own classes, you must have JDK, but if you want to run this java program, you must have JRE. Usually the JRE is divided into the JDK, but we learn to divide them into two parts.

JRE: The running environment of java, including the java virtual machine and the java basic class library , is the software environment required for the running of programs written in the java language, and is provided to users who want to run java programs . It is to run the .class bytecode file, and then let the jvm parse it accordingly.

JDK is a software development kit for java language, including java runtime environment (jre), a bunch of java tools (javac/java/jdb) and java basic class library (java API)


The JVM is a fictional computer. The java language uses the jvm to shield the information related to the specific platform, so that the java language compiler only needs to generate the object code (bytecode) running on the java virtual machine, and the jvm will convert the bytecode. Interpreted into the execution of machine instructions for a specific platform, this is why java can be compiled once and run everywhere.


We use JDK (calling javaAPI) to develop our java program

Compile the .java we wrote into .class through the compiler (javac) in the JDK

Run these java bytecodes on the JRE, and the jvm parses these bytecodes and translates them into machine instructions for specific platforms.


Execution order: JDK----JRE----JVM----OS



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325993209&siteId=291194637