Concepts of JRE and JDK

Source: Internet
Author: User
Concepts of JRE and JDK

 

JDK

JDK is the core of the entire Java, including the Java Runtime Environment (Java Runtime Envirnment), a bunch of Java tools and the Basic Java class library (rt. jar ). No matter what Java application server is actually built into a certain version of JDK. the most popular JDK is the JDK released by Sun. In addition to Sun, many companies and organizations have developed their own JDK, such as JDK developed by IBM and Jrocket of BEA, and JDK developed by GNU. Among them, the JVM (Java Virtual Machine) Running Efficiency of ibm jdk is much higher than that of Sun JDK. The Jrocket running on the x86 platform is much more efficient on the server than Sun JDK. However, we still need to Master Sun JDK first.

JDK generally has three versions: SE (J2SE), standard edition, and standard edition. It is a common version of EE (J2EE), enterpsise edtion, and Enterprise edition, this JDK is used to develop J2EE applications, such as ME (J2EE) and micro edtion. It is mainly used for java development tools (JDK) for Java applications on mobile devices and embedded devices) it is the development environment that many Java experts initially use. Although many programmers have used third-party development tools, JDK is still an important tool for Java development. JDK consists of a standard library and a set of Java utilities that are created, tested, and documented. Its core Java API is some predefined class libraries. developers need to use these classes to access Java functions. Java APIs include some important language structures and basic graphics, networks and files I/O. generally, the non-I/O part of Java APIs is the same for all platforms running Java, while the I/O part is only implemented in the general Java environment.

As a JDK utility, there are seven main tools in the tool library.

Javac: a Java compiler that converts Java source code into bytecode.

Java: Java interpreter, which executes Java application Byte Code directly from class files.

Appletviewer: applet browser, a Java browser that executes Java applets on HTML files.

Javadoc: Generate HTML documents based on Java source code and instructions.

Jdb: Java debugger that can execute programs one by one, set breakpoints and check variables.

Javah: generate the C process that can call the Java Process, or create the header file of the C process that can be called by the Java program.

Javap: Java anti-assembler that displays the accessible functions and data in the compilation class file and the meaning of the byte code.

JRE

JRE (Java Runtime Environment, Java Runtime Environment), a set of environments required to run JAVA programs, including JVM standard implementation and Java core class libraries. Is Sun's product, which includes JavaRuntimeEnvironment and JavaPlug-in. JavaRuntimeEnvironment (JRE) is a Java platform on which applications can be run, tested, and transmitted. It includes Java virtual machine, Java platform core class, and support files. It does not contain development tools-compilers, debuggers, and other tools. JRE needs auxiliary software -- JavaPlug-in -- to run the applet in the browser. j2RE is Java2 Runtime Environment, that is, Java Runtime Environment, sometimes referred to as JRE. if you only need to run a Java program or Applet, download and install it. If you want to develop Java software on your own, download JDK. JRE is included in JDK. note: because Microsoft does not fully support Java, do not use the virtual machine that comes with IE to run the Applet. Be sure to install a JRE or JDK.

The Java Plug-in software allows Java applets and JavaBeans components to run in a browser using Sun's Java Runtime Environment (JRE), instead of using the default Java
Run in the browser of the running environment. Java Plug-in can be used for Netscape Navigator and Microsoft Internet Explorer

Differences between JDK and FRE   

In short, JDK is an SDK for developers. It provides a Java development environment and a runtime environment. SDK is a Software Development Kit, which generally refers to a Software Development Kit,
It can include function libraries and compiled programs. JDK is the Java Development Kit, and JRE is the Java Runtime Enviroment refers to the Java Runtime Environment, which is intended for Java program users,
Rather than developers.
If JDK is installed, there will be two sets of JRE on your computer, one in the \ jre and the other in the C: \ Program Files \ Java \ j2re1.4.1 _ 01 directory, this is less than the previous one.
But simply copy the previous set of Server-side Java virtual machines. In addition, you can choose whether to install
C: \ Program Files \ Jav. If you only install JRE instead of JDK, only a unique set of JRE will be installed in the C: \ Program Files \ Java directory.
The status of JRE is just like that of a PC. The Win32 application we write requires the operating system to help us run it. Similarly, the Java program we write must also run JRE. So when
After installing JDK, if two sets of JRE are installed in two different locations on the hard disk, you can imagine that your computer has two virtual Java PCs, all have the function of running Java programs. So
We can say that as long as your computer has installed JRE, you can run the Jav a application correctly.
1. Why does Sun need JDK to install two identical JRE? This is because JDK has a lot of Java-compiled development tools (such as javac.exe‑jar.exe) and
\ Lib \ tools. jar. As shown in the following example, change tools.jarto tools1.jar, and then run javac.exe. the following result is displayed:
Exception in thread "main" java. lang. NoClassDefFoundError: com/sun/tools/javac/Main.
Enter java-cp c: \ jdk \ lib \ tools. jar com. sun. tools. javac. Main in the same format and get the same result. From this we can prove that javac.exe is just
Wrapper (Wrapper), which is created to prevent developers from entering too long fingers. In addition, we can find that the programs in the \ lib directory are very small, not greater than 2 9 K.
We can draw a conclusion. That is, the tools in JDK are almost written in Java, so they are also Java applications. Therefore, we need to use the tools attached to JDK to develop Java programs,
You must also attach a set of JRE, so the JRE located in the C: \ Program Files \ Java directory is used to run general Java programs.
2. If two or more JRE are installed on a computer, who will decide? This major task falls on java.exe. The job of Java.exe is to find the appropriate JRE to run the Java program.
Java.exe searches for JRE in the following order: whether JRE is in its Directory; whether JRE is in its parent directory; Query registry: [HKEY_LOCAL_MACHINE \ SOFTWARE \ ft oft \ Java
Runtime Environment] The running result of java.exe has a great relationship with which JRE is executed on your computer.
3. Introduction The Bin directory under the jvm jre directory has two directories: server and client. This is where the real jvm. dll is located. Jvm. dll cannot work independently. When jvm. dll is started
Use the explicit method (that is, use LoadLibrary () and GetProcAddress () in the Win32 API to load the dynamic link library of the secondary service), and these dynamic link libraries of the secondary service (. dll)
All must be in the parent directory of the directory where jvm. dll is located. Therefore, you only need to set the PATH to the JVM. dll under the directory where JRE is located.

 

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.