Home > Java > javaTutorial > Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

黄舟
Release: 2017-03-29 10:24:26
Original
2243 people have browsed it

For students who are new to Java, the first thing is not to write hello world, but to set up a Java development environment and download jdk, Install , configure environment variables . These operations are configured differently in different operating systems such as xp, win7, and win8. Here are the instructions in this article Let us introduce how to configure the above different operating systems

For students who are new to Java, the first thing is not to write hello world, but to set up a Java development environment, download jdk, install it, and configure environment variables. These operations are configured differently in different operating systems such as xp, win7, and win8, so I will write about how to configure them under the above different operating systems. and 64-bit)

XP#1. 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\Java\jdk1.6.0_10;

2. After the installation is completed, right-click "My Computer" and click "Properties

”. Click “Advanced System Settings” and click “Environment Variables”, as shown in the figure: ##", set 3 properties, namely JAVA_HOME, PATH, CLASSPATH (it doesn't matter the case, it is best to use uppercase). If these 3 properties already exist, click "Edit", if they do not exist, click "New" (1 ).JAVA_HOME indicates the JDK installation path, which is the path you just selected during installation: C:\Program

##Files\Java\jdk1.6.0_10, as shown in the figure:

(2) Add under the Path item: ;%JAVA_HOME%\bin; %JAVA_HOME%\jre\bin. Note that it is separated from the previous content by a semicolon, as shown in the figure:
Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

##(3) Add in the CLASSPATH item: .;JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar (note the "." in front).

##             

Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

##4. "Start" -> "Run", type "cmd", type the command "javac", the following screen appears , indicating that the environment variables are configured successfully. As shown in the picture:


Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

win7


Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)1. Install JDK, you can install it yourself Define the installation directory and other information. For example, we choose the installation directory as: C:\Program Files\Java\jdk1.6.0_21; (The red area has different numbers depending on the version). 2. After the installation is complete, right-click "Computer" and click "Properties", as shown in the figure:

 


##3. Click "Advanced" System Settings", click "Environment Variables", as shown in the figure:
Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

##4. In "System Variables", set 3 properties , JAVA_HOME, PATH, CLASSPATH (case does not matter), if it already exists, click "Edit", if it does not exist, click "New":

(1).JAVA_HOME specifies the JDK installation path, which is just now The path selected during installation is C:\Program Files\Java\jdk1.6.0_21, as shown in the figure:


Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

##(2).Path Add: ;%JAVA_HOME%\bin; %JAVA_HOME%\jre\bin, note that they are separated by semicolons, as shown in the figure:


Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

(3). Add in the CLASSPATH item: .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar (note the "." in front), as shown in the figure:


Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

5. "Start" -> "Run", type "cmd", type the command "javac", the following screen will appear, explaining the environment variables Configuration successful. As shown in the picture:


Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

##win8

#1. Install JDK, you can install it yourself Define information such as the installation directory. For example, we choose the installation directory as: C:\Program Files (x86)\Java\jdk1.7.0_40; (The red area has different numbers depending on the version).

2. After the installation is complete, right-click "My Computer"-----"Properties"-----"Advanced System Settings"------"Advanced"---- -----"Environment variables", as shown in the figure:

Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)


Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

##3. New ( There is no need to create a new one if it already exists) System variable

Variable name

JAVA_HOME, Variable value C:\Program Files (x86)\Java\jdk1.7.0_40 (This is my jdk

Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)Installation path)


Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

4. Find the Path system variable, edit it, and add % at the beginning of the variable value JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;

Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)

5. Find the system variable CLASSPATH, if not, create a new system variable and variable value. ;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar; (note the "." in front of

).


Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)6.win+R and enter cmd, when the window comes out, enter java and press enter, javac and press enter. It will be successful when it comes out as shown

Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8)


The above is the detailed content of Detailed graphic and text introduction to java (jdk) environment variable configuration (XP, win7, win8). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template