Determine your operating system version and download the installation JDK
1. Download JDK
Windows system:
Right-click My Computer--properties such as:
2. Download JDK
: http://www.oracle.com/index.html
(1) Click the I am a developer tab, select Java Developer
(2) Click the Download button to go to the download page
(3) Continue to click the Download button
(4) Agree to the agreement and download the JDK for the corresponding platform
Introduction to JDK installation and various directory functions
1. Introduction to JVM, JRE, JDK
Jvm:java virtual Machines
Jre:java Runtime JVM + Core class library (Files run by auxiliary Java virtual machines)
Jdk:java's Development toolset JRE + Java development tools
The JDK is a more complete Java toolkit, so installing the JDK is almost ready.
2. JDK Installation
Double-click the downloaded JDK installation package to install it.
Note: Settings for the installation path
The JDK installation package contains the JRE, but will be prompted to install the JRE during installation, which can be installed without installation.
3. JDK Directory function
(1) First look at the files and folders contained in the JDK directory:
Description of the JDK directory:
Bin: The Java development tool is stored.
Db:jdk7 comes with a lightweight database named Derby.
Include: the interface file that holds the calling system resource.
Jre:java Operating Environment
LIB: Core class library.
Src.zip:java Source Code
(2) file directory in bin directory
The bin directory is stocked with Java development tools, which focus on explaining Javac.exe and Java.exe.
Javac.exe: Launches the compiler to compile the specified source file, generating a. class file.
Java.exe: Starts the Java Virtual machine to interpret and execute the specified class file.
Configuration of environment variables
How to configure the path for Windows:
Environment variables, advanced system settings, properties----Right My Computer
1, you can use the SET command to view the information of each environment variable
2. Configuring Java_home Environment variables
Objective: To prevent frequent changes to the path.
Step: Create the JAVA_HOME environment variable, store the variable part of the JDK installation directory section, and then refer to the environment variable in percent to the path file.
Example: JAVA_HOME:D:\JAVADEVELOPER\JDK
3. Configure path
Role: The console can find the application (. exe) with the path path configured under any path
Purpose: Java configures the PATH environment variable to be used by the console to find Java development tools under any path.
For example: path:%java_home%\bin;
Sum up:
The goal of configuring Java_home is to prevent frequent changes to the path.
The purpose of configuring the PATH environment variable is that the console can find Java development tools under any path.
4. CLASSPATH Environment variables
General CLASSPATH environment variables are set to temporary environment variables.
Function: When the JVM is started, the JVM will look for the corresponding class file according to the path information saved by the CLASSPATH environment variable.
Attention:
1. If the configuration classpath environment variable information does not include a semicolon, then the Java Virtual machine will only search for the corresponding class file in the path saved by Classpath, and will not search the current path down.
2. If you configure the CLASSPATH environment variable information plus a semicolon, the Java Virtual machine will search for the corresponding class file in addition to the path saved by Classpath, if it can find the corresponding class file
Then immediately specify the corresponding class file, otherwise you will go to the current path down search.
Building a Java development environment