Construction of development environment

Java development can be done in a Windows environment or a Linux environment. Now let's build a development environment in the Windows environment. This article takes jdk8 as an example.
To download the JDK,
first we need to download the java development kit JDK, the download address: http://www.oracle.com/technetwork/java/javase/downloads/index.html, click the download button as follows:
Insert picture description here
Insert picture description here
After downloading, the JDK installation will proceed according to the prompts , JRE will also be installed when JDK is installed, just install it together.

Install JDK, you can customize the installation directory and other information during the installation process. For example, we choose the installation directory as C:\Program Files (x86)\Java\jdk1.8.0_91.

Configure environment variables
1. After the installation is complete, right-click "My Computer", click "Properties", select "Advanced System Settings";
Insert picture description here
2. Select the "Advanced" tab, click "Environment Variables";
Insert picture description here
then the following picture will appear The screen shown:
Insert picture description here
Set 3 attributes in "System Variables", JAVA_HOME, PATH, CLASSPATH (the case does not matter), if it already exists, click "Edit", if it does not exist, click "New".
Note: If you use JDK version 1.5 or higher, you can compile and run Java programs normally without setting the CLASSPATH environment variable.
The variable setting parameters are as follows:
Variable name: JAVA_HOME
Variable value: C:\Program Files (x86)\Java\jdk1.8.0_91 // To configure according to your actual path
Variable name: CLASSPATH
variable value: .;%JAVA_HOME%\lib \dt.jar;%JAVA_HOME%\lib\tools.jar; //Remember that there is a "."
variable name in front : Path
variable value: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
JAVA_HOME set
Insert picture description hereInsert picture description here
PATH setting
Insert picture description here
Insert picture description here
attention : In Windows 10, the Path variable is displayed separately, we need to add %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin; separately, otherwise it will not be recognized:

%JAVA_HOME%\bin;
%JAVA_HOME%\jre\bin;
CLASSPATH setting
Insert picture description here
This is the Java environment configuration. After the configuration is complete, you can start Eclipse to write code, and it will automatically complete the java environment configuration.
To test whether the JDK is installed successfully
1. "Start" -> "Run", type "cmd";
2. Type the command: java -version, java, javac and the following information appears, indicating that the environment variable configuration is successful;
Insert picture description here

Guess you like

Origin blog.csdn.net/jassyzhen/article/details/109345571