1.4.1 Download and install the JDK for Java 7

Source: Internet
Author: User
Tags windows x64 windows x86 java se

The full name of the JDK is the Java SE Development Kit, the Java Standard Development package, a development package for Java applications developed by Sun, which provides the tools and resources needed to compile and run Java programs, including the Java compiler, Java runtime Environment, as well as common Java class libraries.

Here's another concept: the Java Runtime Environment, which is the Java Runtime Environment, is also known as the JRE, which is a prerequisite for running Java programs.

Student Questions : not the JVM is the virtual machine that runs the Java program? What is the relationship between the JRE and the JVM?

Answer : to put it simply, the JRE contains the JVM. The JVM is the core virtual machine that runs Java programs, and running Java programs requires not only the core virtual machines, but also other classloader, bytecode validators, and a large number of base class libraries. In addition to the JVM, the JRE contains additional environment support for running Java programs.

In general, if you just run Java programs, we can install only the JRE without installing the JDK.

Note: If you need to develop a Java program, you should choose to install the JDK, and of course, after the JDK is installed, the JRE is included, and the Java program can be run, but if you just run Java programs, you need to install the JRE on your computer. Installing only the JVM is not enough. In fact, the download of the JRE is provided on the Sun's website, not a separate JVM.

Sun has divided Java into Java se,java EE and Java me three parts, and for Java SE and Java EE respectively, the JDK and Java EE SDK (software decelopment kit) Two development packages, if the reader only need to To learn the programming knowledge of Java SE, you can download the standard JDK, and if the reader learns Java SE, it is necessary to continue to learn Java EE related content, or to download the Java EE SDK, there is a Java EE SDK version contains the latest version of the JDK, install Java The EE SDK contains the JDK.

The content of this book is mainly about Java SE, so download the standard JDK. To download and install the JDK, follow the steps below.

    1. Log on to the http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html page to download the latest version of the Java SE Development KIT. At the time of the book, the latest version of the JDK is JDK 7, and all the cases are based on this version of the JDK.

    2. Click on the link to page 1.2 to access the download page for JDK 7. Readers should choose the appropriate JDK version based on their platform: for the Windows platform, you can choose either Windows x86 or the Windows x64 version, and for Linux platforms, download the JDK for the Linux platform.


    3. After the download succeeds, get a Jdk-7-windows-i586.exe file, which is a standard EXE file that can be run by double-clicking the file. For JDK installation files on a Linux platform, simply add the executable properties to the file and execute the installation file.

    4. After starting the installation, the first dialog asks whether or not to agree to the Java License Agreement certificate, a stand-alone "accept" button to enter the 1.3 Component Selection window.

      Most of the time, you don't need to install all the components. In Figure 1.3, the author chooses to install three components of the JDK.

      Java Development tool: This is the core of the JDK, including the command tools necessary to compile the Java program. In fact, this option already contains the JRE that runs the Java program, which is installed in a subdirectory of the JDK installation directory, which is why the author does not install the public JRE.

Student Question: Why not install a public JRE?

A : the public JRE is a standalone JRE system that is installed separately under the other paths of the system. The public JRE registers the Java Runtime Environment with the Internet Explorer browser and system. In this way, the public JRE can be used by any application in the system. Since there are fewer opportunities to execute applets on Web pages, and it is entirely possible to run Java programs using the JRE under the JDK directory, it is not necessary to install a public JRE.

Demo program and sample: Installing this option will install the numerous demos and sample code provided by Oracle to the machine, which is an introductory example of learning Java for beginners.

Source code: Installing this option will install the source code for all of the core class libraries in Java.

5. Choose the installation path of the JDK, the system is installed by default under the C:\Program files\java\jdk1.8.0_45\ path, but the author does not recommend installing in the path with spaces, this may lead to some unknown problems, it is recommended to install directly under the root path, example 1.3 shows the D:\java\jdk1.8.0_45\. Stand-alone "next" button, waiting for the installation to complete.

After the installation is complete, you can see the following file paths under the JDK installation path.

  • Bin: The various tool commands for the JDK are stored under the path, and the common Javac and Java commands are placed under the path.

  • DB: Change path is the path to install Java DB.

  • Demo: The demo code provided by the JDK is stored under the path, and the demo code can be referenced by beginners.

  • JRE: The path is installed under the JDK Tool command of the actual execution program, if you use WinRAR open the Lib path under the Tool.jar file, you will see the file structure.

    Tips: The javac.exe command used to compile the Java program is also written in Java, which is the main class under the Sun\tools\javac path in the Tool.jar file under the Lib path. The Javac.exe command under the bin path of the JDK actually simply wraps the Java class, and most of the commands under the bin path are wrapping the tool class in the Tools.jar file.

1.4.1 Download and install the JDK for Java 7

Related Article

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.