JDK configuration

JDK:

Java development kit 

The Java development environment 
includes both the development environment and the runtime environment.
Why do you need to set environment variables?

The Windows operating system executes your command in two steps. The first step is to find the executable file in your directory. If it is not found, the second step is to find it in the environment variable. If it is found, it will be executed, and if it is not found, an error will be reported. As long as the Java installation directory is added to the environment variable, Java commands can be executed anywhere.

The configuration of JDK environment variables is divided into three steps:

The environment variable of jdk is to be written in the system environment variable 
一 JAVA_HOME 
Write the location of your own JDK. 
For example, my JDK is placed on the F: disk. Find the JDK directory file and copy and paste it 
. F:\Java\jdk1.8.0_171 
The name JAVA_HOME cannot have any transformation. This is a rule that it must be Write like this. 
For example, there are three people ABC, A wants to use the code of B and C, and needs to use JDK, but the JDK installation directories of B and C are different, then the role of JAVA_HOME comes out at this time, so that they all have different JDK installation directories. Name the installation path of the JDK environment variable as JAVA_HOME. A just need to find the environment variable named JAVA_HOME.

Two PATH 

Add the path %JAVA_HOME%\bin  of your own BIN directory ;
to put it bluntly, it is actually adding %JAVA_HOME%\bin to the PATH to find the javac in your bin folder 
; just to find the bin in any current path JAVAC file that implements Java commands. 
Add F:\Java\jdk1.8.0_171\bin directly to the path; you can also execute JAVA commands on your computer, but others cannot call them. 

Three CLASSPATH 

.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar 
For the configuration of CLASSPATH, I really don't understand, I don't know what is the meaning of this writing, what is the necessity, I am also looking for the answer.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324695375&siteId=291194637