JDK1.8.0_74 installation and environment variable configuration (win10)

1. Install the jdk file

I put the file in the following network disk

Link: https://pan.baidu.com/s/1I9DwpmAF-hnByoPk8bmZBw?pwd=1234 
Extraction code: 1234 

Click to install

Set the installation location, here I take D drive as an example

The following path is uniformly replaced with the path I set (there is a jre that needs to create a new folder by itself, and it can be set under the java path according to the prompts he gave you)

Right click my computer and click properties

Click on Advanced system settings

 

 Note that it is a system variable, click New

 New variable named

JAVA_HOME

variable value

D:\Program Files\Java\jdk1.8.0_74

The variable value is your JDK path (make no mistake, jdk and jre are in the same folder)

 Create a new CLASSPATH  variable, the variable value is
.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar

 Find the Path system variable, select it and click Edit

enter   

%JAVA_HOME%\bin

 win+R, enter the cmd command window

enter java

 The result is normal

Enter java -version

 The result is normal

enter javac

 The result is normal

Installation and configuration are complete

Note: I can't start to enter javac because I use my own installation path. I tried it once without changing the path. The default path can install javac. The error-prone thing here is that you only change one installation path. The installation process There are two paths to be changed, the first is the jdk path, and the second is the jre path. They are all under the java folder. The location of the folder you installed last needs to be the same as mine, otherwise the javac command cannot be found.

Guess you like

Origin blog.csdn.net/qq_44741467/article/details/122320648