Build a Java development environment,
Determine your operating system version and download and install JDK
1. Download JDK
Windows:
Right-click my computer and choose Properties. For example:
2. Download JDK
: Http://www.oracle.com/index.html
(1) Click the I am a developer tab and select java developer.
(2) Click the Download button to go To the Download page.
(3) Click download.
(4) Agree to the agreement and download the JDK of the corresponding Platform
JDK installation and various directory Functions
1. Introduction to jvm, jre, and jdk
Jvm: Java Virtual Machine
Jre: Java Runtime Environment jvm + core class library (files used to assist Java virtual machines)
Jdk: Java Development Tool Set jre + java Development Tool
Through the above introduction, we can use JDK as a complete java toolkit, so we have almost finished installing JDK.
2. JDK Installation
Double-click the downloaded jdk installation package to install it.
Note: installation path settings
The jdk installation package contains jre, but a prompt will be prompted during the installation process to install jre. This jre can be installed or not.
3. JDK directory Functions
(1) Let's take a look at the files and folders contained in the jdk directory:
Jdk directory introduction:
Bin: stores java development tools.
Db: a lightweight database attached to JDK 7, called Derby.
Include: stores the interface files for calling system resources.
Jre: java Runtime Environment
Lib: Core class library.
Src.zip: java source code
(2) file directory under the bin directory
The bincontents are stored in Java development tools.
Javac.exe: starts the compiler to compile the specified source file to generate the. class file.
Java.exe: Start the Java Virtual Machine to interpret and execute the specified class file.
Environment variable configuration
How to configure the path for windows:
Right-click my computer and choose Properties> advanced system Settings> environment variables.
1. You can use the set command to view information about environment variables.
2. Configure the JAVA_HOME environment variable
Objective: To prevent frequent path changes.
Step: Create the JAVA_HOME environment variable, store the variable part in the jdk installation directory, and use % to reference the environment variable to the path file.
Example: JAVA_HOME: D: \ JavaDeveloper \ JDK
3. Configure path
Purpose: The console can find the pathpattern application (.exe) in any region)
Objective: to configure the path environment variable in java, you can find the java development tool in any path on the console.
Example: path: % JAVA_HOME % \ bin;
To sum up:
The purpose of configuring JAVA_HOME is to prevent frequent path changes.
The purpose of configuring the path environment variable is to find the java development tool in any path on the console.
4. classpath Environment Variables
Generally, the classpath environment variables are set as temporary environment variables.
Purpose: When the Jvm is started, the Jvm will find the corresponding class file based on the path information stored in the classpath environment variable.
Note:
1. If the classpath environment variable information is configured without a semicolon, the Java Virtual Machine will only search for the corresponding class file in the path saved by the classpath, and will not search for the corresponding class file in the current path.
2. If the classpath environment variable information is configured with a semicolon, the Java VM searches for the corresponding class file in addition to the path saved by the classpath. If the corresponding class file can be found
Specify the corresponding class file immediately. Otherwise, the file will be searched in the current path.