[Java Foundation II] JDK installation and environment variable configuration

1. JDK download operation

You need to enter the Oracle official website http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html to download the required JDK version (this article uses 1.8), the system needs to specify i586 for 32bit operating system , X64 stands for 64bit operating system.

Note: You need to select the "Accept License Agreement" option when downloading.

2. JDK installation operation

After the download is complete, directly double-click the .exe file to perform the next operation, and avoid Chinese characters when selecting the path. Set the installation path to D:\Soft_Installation\Development\Java (according to your own preferences). It is best to put JDK and JRE in the same directory when installing.

3. Configure environment variables

Right-click the My Computer (OR computer) icon on the desktop, select "Properties", select "Advanced System Settings", and click "Environment Variables".

 

① Configure JAVA_HOME environment variable:

 

In the system variables, click "New", the variable name is JAVA_HOME, and the variable value is the installation path of jdk in the java installation directory. For example, I installed it in D:\Soft_Installation\Development\Java, and the variable value is it. Click OK to complete the configuration.

② Configure the classpath environment variable:

classpath=.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\tools.jar

. Represents the current path, the classpath refers to other packages, mainly under lib and dt.jar, tools.jar are the source files when the JVM is loaded

 

 

 

③ Configuration of Path variable:

The Path variable is an environment variable that comes with the system, no need to create a new one, just add the jdk bin directory to the variable value. Find the path variable, click "Edit", and then enter an English ";" after the original value, and then add the jdk bin directory. The installation directory is D:\Soft_Installation\Development\Java, and the added value is %JAVA_HOME%\bin. Then click "OK" to complete the configuration.

4. Whether the test environment is successfully configured

Open the cmd window (shortcut key is WIN+R), enter the DOC window

> 1. Use the java command (this command can verify whether your JDK is installed successfully, but you cannot confirm whether your environment variables are configured successfully, you can use javac or Java -version commands for verification)

>2. Run the javac command

> 3. Run the java -version command to display the version of your currently configured JDK

According to the above command test, it shows that your JDK is installed and configured successfully, and you can use the Java language, which will bring you endless fun.

 

 

Previous:  [One of the Java Foundations] A basic introduction to the Java programming language                                                                             

Next article:  [Java Basics 3] Java basic hexadecimal and mutual conversion

 

 

 

Guess you like

Origin blog.csdn.net/dgxin_605/article/details/80413048