JDK and two JRE

Source: Internet
Author: User

Original:http://renyongjie668.blog.163.com/blog/static/160053120101711162373/



last night saw someone on the csdn to ask the JRE, suddenly remembered a classmate and I said, after installing the JDK there are two JRE directory and their differences, and now carefully combed a bit, summed up it.

The JDK is Java development Kit. To put it simply, the JDK is a developer-oriented SDK that provides a Java development environment and a running environment. The SDK is software Development Kit generally refers to a software development package, which can include function libraries, compiler programs, and so on.
The JRE is Java runtime enviroment, which refers to the Java Runtime Environment, and is intended for users of Java programs, not developers.

If the JDK is installed, there are two sets of JRE on your computer, and I take the default installation path, a set of D:\Program files\java\jdk1.6.0_02 \jre, the other set is located D:\Program files\java\jre1.6.0_02 Directory, the back of this set than the previous set of server-side Java Virtual machine, but directly the previous set of server-side Java Virtual machine to copy over the line. You can also choose whether to install the JRE in the D:\Program Files\java directory when installing the JDK. If you install only the JRE, not the JDK, only a single set of JRE will be installed in the C:\Program Files\java directory. This is normal phenomenon, after the installation of a good path can be used.

two sets of JRE, is for different job responsibilities! Different JRE is responsible for the contents of the respective scopes.
when the user only needs to execute Java program, then D:\Program files\java\jre1.6.0_02 the JRE is OK!
when the user is a Java programmer, the Java development environment is required. At compile time, the system will take precedence to find the "Java, Javac" directories under D:\Program Files\java\jdk1.6.0_02\bin or the JRE of their parent directory. That is, the JRE under the JDK is running under the development environment.

Three Lib directories, the Lib folder location is as follows:
D:\Program Files\java\jdk1.6.0_02\jre\lib
D:\Program Files\java\jre1.6.0_02\lib
D:\Program Files\java\jdk1.6.0_02\lib
Lib under the lib;jdk under the Lib;jre under the JDK, respectively.
The Lib under the JDK includes the jar package for the Java development environment, which is for the JDK, such as some tools under the JDK that might be used for files in that directory. For example, compilers, and so on.
Lib under the JRE is just a jar package that runs Java programs and is used for the JVM runtime. Includes all the standard class libraries, and extension classes.
The Lib under the JRE under the JDK is the jar package required for the runtime in the development environment, most typically the imported external drive jar package. Because at compile time, the system is looking for the JRE under the JDK. Instead of the outermost JRE.
-----------------------------------------
Finally, here are a few things to add:
1. Classpath,eclipse that do not need to be specified when using eclipse will search by themselves.
2. The JRE under the standalone directory is a generic JRE, which is optional when installed (it overwrites the existing version). The JRE under the JDK directory is required. If you specify the path to the JDK in eclipse (the path of the JRE is not specified, you will find it yourself), then this is the JRE. Java, Web, start, etc., use the generic JRE.

Reference Documentation: Http://www.cnblogs.com/suyang/archive/2008/03/12/1101330.html

JDK and two JRE

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.