Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deeply analyze the difference between JDK, JRE and JVM

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article shows you how to deeply analyze the difference between JDK, JRE and JVM. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Do you know the difference and connection among jdk,jre,jvm? let me share with you here, j2sdk (Software Development Kit for Java 2), or JDK for short. It includes JDK (Java Development Kit), JRE (Java Runtime Environment), Java Plug-in. JDK is the Java development kit. JDK is a set of API, or some java Class.

Jdk,jre,jvm distinction

◆ j2sdk (Software Development Kit for Java 2), referred to as JDK. It includes JDK (Java Development Kit), JRE (Java Runtime Environment), Java Plug-in. JDK is the Java development kit. JDK is a set of API, or some java Class. JDK is the foundation of all java applications, and all java applications are built on this. Located in the Java installation directory\ jdk1.5.0_07.

◆ JRE (Java Runtime Environment), which is essential for running Java programs (unless compiled into an .exe executable file in some other compilation environment. The status of JRE is like a PC. The Win32 applications we write need the operating system to run for us. Similarly, the Java programs we write also need JRE to run. So when you install JDK, if you install two sets of JRE in two different places on your hard drive, you can imagine that your computer has two virtual Java PCs, both of which can run Java programs. So we can say that as long as your computer has JRE installed, you can run Java applications correctly. There is a JVM in JRE. JRE is related to the specific CPU structure and operating system. When we download JRE from Sun, we see different versions. Together with JVM, there are also some API (such as awt, swing, etc.) that make up JRE. JRE is essential for running Java programs.

◆ JVM is the foundation of the Java platform, and like real machines, it has its own set of instructions and operates on different memory areas at run time. JVM provides a platform-independent code execution method through abstract operating system and CPU structure, that is, it is independent of special implementation method, host hardware and host operating system. But in some small aspects, the implementation of JVM is also different, such as garbage collection algorithm, thread scheduling algorithm (different OS may have different implementations). The main job of JVM is to interpret its instruction set (that is, bytecode) and map it to the instruction set of local CPU or the system call of OS to protect users from malicious programs. JVM doesn't care about the upper-level Java source file, it only cares about the class file (class file) generated by the source file. Class files are composed of JVM instruction sets, symbol tables, and some subsidy information.

To run Applet, JRE must be installed on the client side, that is, "runtime", which is easier to understand, just like the so-called "plug-in". To develop JAVA applications\ Web applications, you must install the corresponding JVM+JDK on the server side (when developing Java web applications, the client does not need to install any JVM)

If you use JAVA to develop applications, you need to install JRE+JDK, that is, J2SE.

If you run Applet on the client, the client browser must have JAVA JVM embedded, if not, it needs to be installed, that is, create JRE on the client (runtime, including JVM), and the client does not need to develop, so it is not necessary for JDK to install different versions of Applet that may not work properly under different JVM, while Microsoft JVM is only a "low version" of Sun JVM, Microsoft simply removes JVM from windows xp/2003.

The above content is how to deeply analyze the difference between JDK, JRE and JVM. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report