The difference between JDK,JRE,JVM

Source: Internet
Author: User

In the development of lua,cocos-2d, need to use Java East, these things between the links are often not very clear, so finishing the next ...

Very good surface of the relationship between the three JDK,JRE,JVM:


JDK

Java Development Kit (JDK) is the Java Language Software Development Kit (SDK). As the Java language SDK, Ordinary users do not need to install the JDK to run Java programs, but only to install the JRE (Java Runtime environment). The program developer must install the JDK to compile and debug the program.

    • SE (j2se), standard Edition, is a version we typically use, starting with JDK 5.0 and renaming Java SE.
    • EE,Enterprise Edition, Business Edition , uses this JDK to develop the Java EE application, starting with JDK 5.0, and renaming it to the same.
    • ME (j2me), Micro Edition, primarily for Java applications on mobile devices , embedded devices, starting with JDK 5.0, renamed Java ME.

If you do not have a JDK, you cannot compile the Java program, and if you want to run only Java programs, make sure that the appropriate JRE is installed. the JDK contains a batch of components for Java development, including:

  • The javac– compiler compiles the source code with the suffix. Java into a byte code with the suffix. Class name.
  • java– Run the tool and run the. Class byte code
  • jar– Packaging tool to package related class files into a single file
  • javadoc– Document generator, extracting documents from source notes, annotations required to conform to specifications
  • JDB Debugger, Debugging Tools
  • jps– shows the status of the current Java program running process
  • javap– Anti-Compiler program
  • appletviewer– tools to run and debug applets without using a browser
  • javah– generates C header files and C source files from Java classes. These files provide a connection glue that enables Java and C code to interact.
  • javaws– Running the JNLP program
  • extcheck– a tool for detecting jar package conflicts
  • apt– Annotation Processing Tool
  • Jhat–java Heap Analysis Tool
  • jstack– Stack Tracker
  • JSTAT–JVM Detection Statistics Tool
  • Jstatd–jstat Daemon Process
  • jinfo– getting the Java program configuration information that is running or crashing
  • jmap– getting Java Process Memory mapping information
  • Idlj–idl-to-java compiler. Converting the IDL language to a Java file
  • policytool– a GUI for policy file creation and management tools
  • jrunscript– Command line script run

The JDK also includes the full JRE (Java Runtime Environment), the Java Runtime Environment, also known as the Private runtime. Includes various library classes for the product environment, such as the base Class library Rt.jar, and supplemental libraries for developers, such as internationalized and localized libraries, IDL libraries, and more. The JDK also includes a variety of sample programs to showcase parts of the Java API.  

jre

JRE : Java  runtime  enviromental (Java Runtime Environment) . that is what we call the Java platform, all Java programs must be under the JRE to run . Includes JVM and Java core class libraries and support files. compared to the JDK, it does not contain development tools-compilers, debuggers, and other tools .   javaruntimeenvironment (JRE) is the Java platform on which applications can be run, tested, and transmitted. It includes the Java Virtual Machine (JVM), the Java Core Class library, and the supporting files. It does not contain development tools (JDK)-compilers, debuggers, and other tools. The JRE requires auxiliary software--java plug-in--to run applets in the browser. java  The plug-in software allows Java applet and JavaBean components to run in a browser using Sun's Java runtime environment (JRE), Instead of running in a browser that uses the default Java runtime environment. Java plug-in can be used for netscape navigator and Microsoft internet explorer.

j2re is JAVA2 runtime environment, the Java Runtime Environment, just emphasizes its matching Java2 platform, 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 your own Java software, download the JDK (the difference between the JRE and JDK). the JRE is included with the JDK. Note Because Microsoft does not have complete support for Java, do not use the virtual machine that comes with IE to run applets, be sure to install a JRE or JDK.  

JVM

Java Virtual machine (Java VM, abbreviated as JVM), aka Java Virtual machine, a VM capable of running Java bytecode, operating on a stack-structured machine . The first implementation, developed by the solar micro-system, is part of the Java platform and is capable of running software programs written in the Java language.

Java Virtual machine has its own perfect hardware architecture, such as processor, stack, register, etc., also has the corresponding instruction system. The JVM masks information related to the operating system platform, making it possible for Java programs to generate only the target code (bytecode) that runs on a Java virtual machine, and to run unmodified on multiple platforms. The implementation of the software implemented by the central Processing unit (CPU) enables the implementation of compiled Java code (applets and applications).

Virtual machines, as a programming language, are not actually dedicated to the Java language, and any language can be run by the JVM as long as the resulting compiled file conforms to the JVM's requirements for loading the compiled file format. Except for Oracle, there are other open source or closed sources implementations.

Java code Run process

The reality of our development is that we have developed our own Java programs using the JDK (calling the Java API), compiled our text Java files into Java bytecode using the compiler program in the JDK (Javac), and run these Java bytecode on the JRE, The JVM parses these bytecode and maps it to a CPU instruction set or system call to the OS.

The difference between JDK,JRE,JVM

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.