JDK installation and environment variable configuration

Reference sourcehttp://blog.csdn.net/bruceyang2009lzu/article/details/28595571

Regarding the two concepts of JDK and JRE: JDK is the core component of java development, which is used to compile and interpret java programs, including java compile (javac), which is aimed at java developers. JRE is a java runtime environment, which is used to support the running of java programs, mainly including JVM. Java is a cross-platform language. It is compiled once and run on multiple computers many times. This mechanism is mainly implemented by the JVM. The Java program compiles the intermediate bytecode, which cannot be run directly on the machine. The intermediate bytecode must be converted into machine language by the JVM. JRE is aimed at java program users.

About JDK installation: The installation process is to click Next, there will be two choices in the path selection, be careful not to customize the same path. When installing the java package, you will encounter two path selections, the first time you choose the jdk path, and the second time you choose the jre path. If the selected jdk installation path is the same as the jre installation path, the content in the jre package will overwrite the content in the jdk package. Therefore, after the installation, the tools.jar and dt.jar packages will not be found, and the environment The configuration of variables has no real effect. Therefore, during the installation process, jdk and jre should be installed under different files. For example, my jdk is installed under "D:\java\jdk", and jre is installed under "D:\java\jre". After installation, the configuration of path and classpath is carried out for JDK, which can be configured as

JAVA_HOME: D:\JAVA\jdk

PATH: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;

CLASSPATH: .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar

Guess you like

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