Java JDK detailed installation configuration (detailed memo version)

1. Download and install

Official download address: Click here to go to the official website

Insert image description here
java20 and java17 are as follows:

Insert image description here
java8, java11 as follows

Insert image description here
jre8 is as follows
Insert image description here


Take java8 download as an example:

Insert image description here
After entering the account password according to the steps
Insert image description here
, the download display box will pop up, and the installation package with
Insert image description here
the file name is obtainedjdk-8u361-windows-x64.exe

The installation diagram is as follows:
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
At this point, java verification can already be used
Insert image description here
, but javac is not yet available, and you need to enter the second step to configure the environment
Insert image description here

PS: If you have the previous installation package, go directly to the second step to configure the environment
Insert image description here

2. Environment configuration

The environment configuration mainly consists of three parts: JAVA_HOME, CLASSPATH, and Path. Both are system environment variables:
Insert image description here
Insert image description here
in the system environment variables, select "New",

  • first variable name
JAVA_HOME
  • 浏览目录The variable value is the directory path of your installation, you can directly use the button below
D:\MyIDE\Java\jdk1.8.0_361

Insert image description here

Insert image description here

  • second variable name
CLASSPATH
  • second variable value
.;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar

Insert image description here

注意: Labels are all entered under the English input mode, such as: . ; % _ These are all English dots
, semicolons, percent signs, slashes, underlines... (copy and paste)

  • The third variable name can be edited directly in Path
    Insert image description here
  • Add 2 new variable values
%JAVA_HOME%\bin
%JAVA_HOME%\jre\bin

Insert image description here
Then click "OK" all the way to exit.

Enter javac to verify
Insert image description here
Enter Java -version to view the version
Insert image description here
At this point, you're done!

3. Frequently Asked Questions

  • question:javac不是内部或外部命令,也不是可运行的程序或批处理文件

  • Method: When editing the path environment variable, do not use the relative path form, use the absolute path (the prerequisite for both java -version and java information to appear)

D:\MyIDE\Java\jdk1.8.0_361\bin
D:\MyIDE\Java\jre1.8.0_361\bin

​​

Guess you like

Origin blog.csdn.net/qq_36292543/article/details/129795601