Differences between JDK and JRE

Source: Internet
Author: User

 

JRE is Java Runtime Environment and JavaProgram. Since it is running, of course it should contain JVM, that is, the familiar virtual machine, and all the class files of Java class libraries are packaged into jar in the lib directory. You can verify it by yourself. Which file is the virtual machine on windows? Is there a JVM. dll in JRE/bin/client? That is, virtual machines.

JDK is a Java development kit and a Java development kit that contains various class libraries and tools. Of course, it also includes another JRE. So why should we include another JRE? In addition, JDK/JRE/bin contains both the client and server folders and a JVM. dll. There are two virtual machines. I don't know if you have noticed this yet?

I believe everyone knows that JDK's bin contains the commands required by various Java programs. The most obvious difference with the bin directory of JRE is that javac is available under JDK, which is very understandable, because JRE is just a runtime environment. It has nothing to do with development. Because of this, JDK's own JRE with the development function will have a client JVM and a server JVM, in the JRE environment, only client JVM is required. DLL is enough.

Do you remember to set the JDK/bin path in the environment variable path? This should be the first step for everyone to learn java. The teacher will tell everyone that javac and Java will not be used if they are not set. The JDK/bin directory contains all the commands. But have you ever wondered whether the Java commands we use are not under the JDK/bin directory but under the JRE/bin directory? Do not believe that you can create an experiment. You can cut the java.exe file in the JDK/bindirectory to another place and run the Java program. What did you find? Everything is OK!

So someone will ask? I have not set the JRE/bin directory to the environment variable?

If Java is provided to most people, they don't need JDK for development, but they only need JRE to run the Java program, so every customer needs to manually set the environment variable. How troublesome is it? When jreinstallation is used, the installation program automatically adds jre's java.exe to the system variables. The verification method is very simple. Go to Windows/system32 and check what has been found? There is a java.exe.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.