Tools/Materials
-
environment variable
-
JDK
method/step
-
First download and install the JDK installation package. During the installation process, pay attention to installing it to another disk, not to the C drive.
-
Open My Computer--Properties--Advanced--Environment Variables:
-
New system variables JAVA_HOME and CLASSPATH
Variable name: JAVA_HOME
variable value: C:\Program Files\Java\jdk1.7.0
Variable name: CLASSPATH
variable value: .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools .jar;The variable value is the file directory where you installed jdk yourself. Pay attention here.
-
Select the environment variable named "Path" in the "System Variables", double-click the variable, add the absolute path of the bin directory in the JDK installation path to the value of the Path variable, and use the semicolon and the existing path. to separate.
Variable name: Path
variable value: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
This is the environment configuration of java. After the configuration is completed, start eclipse directly, and it will automatically complete the configuration of the java environment -
Now test whether the configuration of the environment variable is successful or not. Enter "JAVAC" in the DOS command line window, and the output of the help information means the configuration is correct. As shown in the figure:
-