What is JDK (java development kit) and what is the use of JDK

Time:2019-11-29

JDK is the first step to learn java well. Whether you want to learn java programming, build JSP Web development environment, or Android development environment, you can’t do without it.

JDK1.6, 1.7, 1.8 installation package: https://www.jb51.net/software/325375.html
Official download address: http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html

What is JDK?

1. What is JDK? JDK is the abbreviation of java development kit, which means Java program development kit. It can also be said that the JDK is a Java SDK.

JDK is a java language software development kit, which is mainly used for Java applications on mobile devices and embedded devices. JDK is the core of the whole java development, which includes the running environment of Java, java tools and java basic class library.

JDK (java development kit) is a java language software development kit (SDK).
Se (J2SE), standard edition, standard edition, is a version we usually use. It was renamed Java Se from JDK 5.0.
EE (J2EE), enterprise edition, enterprise edition, use this JDK to develop J2EE applications, starting from JDK 5.0, renamed Java EE.
Me (J2ME), Micro Edition, is mainly used for Java applications on mobile devices and embedded devices. It was renamed java me from JDK 5.0.
Without JDK, Java programs cannot be compiled. If you want to run only Java programs, make sure that the corresponding JRE is installed.

轻松了解JDK是什么

2. Let’s talk about the JDK version. There are three versions: Standard Version, enterprise version and mobile device version.

轻松了解JDK是什么

3. I don’t know if you can see Java se 6.0 and JDK1.6 are the first two big ones on the Internet. In fact, they are the same thing. Because JDK has been renamed Java se since version 1.5, we usually use J2SE, which is the standard version of JDK.

轻松了解JDK是什么

4. What is JRE?

Ordinary users do not need to install JDK to run Java programs, but only need to install JRE (Java runtime environment). The program developer must install JDK to compile and debug the program.

轻松了解JDK是什么

5. What is JDK?

As the name implies, it is a development toolbox provided for developers, and is used by program developers. In addition to the complete JRE (Java runtime environment), Java runtime environment, it also includes other toolkits for developers.

轻松了解JDK是什么

Understanding JDK by installing Java se 6.0

1. The correct name of the JDK1.6 we installed is actually Java se Development Kit 6, which is the Java standard development kit, version 6.0.

轻松了解JDK是什么

2. Let’s take a look at the installed directory structure. When entering the installation directory, we can see the JRE directory, which is required for running Java programs.

轻松了解JDK是什么

3. Enter the bin folder of the installation directory, and we can see some toolkits mentioned before, such as javac, Javadoc, etc.

轻松了解JDK是什么

The difference between JDK and JRE

You must choose whether to install a separate JRE when installing JDK. Generally, it will be installed together. I also suggest that you do this.
Because this will help you to understand the difference between them:

JRE is the Java runtime environment, which is the running environment of Java programs. Since it is running, of course, it should include the JVM, the familiar virtual machine, and all the class files of Java class libraries, which are packaged into jars in the Lib directory. You can verify it yourself. Which file is the virtual machine on windows You know what a DLL file is after learning MFC, so let’s see if there is a jvm.dll in JRE / bin / client? That’s the virtual machine.

JDK is the java development kit, which contains various class libraries and tools. Of course, another JRE is included. So why another JRE? In addition, JDK / JRE / bin contains a jvm.dll in both the client and server folders There are two virtual machines. I don’t know if you have noticed this?

I’m sure you all know that there are various commands needed by Java programs in the bin of JDK. The most obvious difference between the bin directory of JRE and that of JDK is that there is javac, which is well understood, because JRE is only a running environment. It has nothing to do with development. Because of this, the JDK with development function will have both client and server JVMs under its own JRE, and only the JRE as the running environment needs only the client jvm.dll.

Remember to set the JDK / bin path in the environment variable path? This should be the first step for you to learn Java. The teacher will tell you that javac and Java cannot be used without setting. It is true that the JDK / bin directory contains all the commands. But has anyone thought that the Java commands we use are not in the JDK / bin directory but in the JRE / bin directory? If you don’t believe you can do an experiment, you can cut the java.exe under the JDK / bin directory to another place and run the Java program. What do you find? All OK!

So someone will ask? I didn’t set the JRE / bin directory to the environment variable?

Imagine if Java does not need to be developed by JDK in order to be available to most people, just JRE to make Java programs run. How troublesome is it for each customer to manually set environment variables? So when you install JRE, the installer automatically adds JRE’s java.exe to the system variable. The verification method is very simple. You can see that the path of the system environment variable has the configuration of “systemroot% / system32;% systemroot%;” at the front. Then go to Windows / system32 to see what you find? There is a java.exe.

If you can forcibly move JDK / bin to the front of system32 variable, you can also force to use Java in JDK / JRE, but unless necessary, I don’t recommend you to do so. Running Java programs with a separate JRE is also a test in the client environment.

Now you should be more clear about the internal relations and differences between JDK and JRE, right?