Win10 system to install Java SE Development Kit (JDK) and environment variable configuration diagram tutorial

  

This article takes win10 system and the current latest Java SE Development Kit 8 as an example for everyone to explain, win7, windows
/' target='_blank'>win8
The system tutorial is similar, but it is not recommended to install JDK8 under winxp.

Java SE Development Kit 8 official download address

32-bit: http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-windows -i586.exe

64-bit: http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-windows-x64.exe

Please download 32-bit/64-bit according to your own system. If you are not sure, you can download 32-bit installation directly.

Java SE Development Kit 8 installation process under win10 system

After downloading, double-click to install, as shown below:

Direct“Next&rdquo ;, as shown below:

To avoid this step, in order to avoid unnecessary trouble, please keep the default installation, especially the installation path, do not change, directly <; next & rdquo; Yes, of course, please feel free to master.

The next step is the jre installation interface, as shown below:

The same, if not necessary, please keep the default installation directory, directly <; next & rdquo;, < Br>

So far, JDK 8 is installed, just click “Close”

Java10 Development Kit 8 environment variable configuration tutorial under win10 system

Right click win10 start menu, select “system”,

click“system ”, as shown below,

In the upper left corner, find "Advanced System Settings", click on it to open the "System Properties" interface,

In this interface, we select the “Advanced” tab, then select the “Environment Variable” below, click on it, as shown below:

This way, we will open the “Environment Variable” & rdquo; configuration interface, the specific configuration process is as follows:

a, we first create a JAVA_HOME variable name in the environment variable, as shown below:

variable name fill in JAVA_HOME, The value of the variable is filled in the JDK installation path. For example, the installation directory of Xiaobian is C:\\Program Files\\Java\\jdk1.8.0_102. Click ““OK” after filling out.

b, next to the classmate's steps to create a new CLASSPATH variable name, as shown below:

variable name CLASSPATH, variable value fill the following line:

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

To avoid errors and unnecessary troubles, please copy and paste directly, and then click OK.

c, then find the Path variable in the system variable, the Path variable does not need to be newly created, the system originally has, we only need to find it point & ldquo; edit & rdquo;, as shown below:
< Br>

After opening the edit, add the following to the beginning of the original content in the variable value:

%JAVA_HOME%\\bin;%JAVA_HOME%\\jre\\bin;

Still, in order to avoid mistakes, please copy and paste directly, complete the click & click "OK".

Where to install the Java SE Development Kit (JDK) and environment variable configuration tutorial under the whole win10 system, we can test whether our environment variables are configured successfully through a piece of code.

public class Test{

public static void main(String args[])

{

System.out.println("This is a JDK test program.");

}

}

Copy this code into Notepad and save it as Test.java.

Then open the command prompt, pay special attention to, due to win10, win8 system permissions, open the command prompt, by right-clicking on the win10 system's start menu, select “ command prompt (administrator) ) & rdquo; Open, do not enter cmd directly in the run to open the command prompt, or it will appear "javac is not an internal or external command" error.

ok, we now open the command prompt (administrator), enter the directory where Test.java is located, and the small version is placed in the root directory c:\\ of the c drive, then you can directly enter it in the command prompt. :

cd /dc:\\

When you come in, type javac Test.java

and continue typing java Test

If this is returned on the screen . a JDKtest program environment variable indicates the successful configuration, as shown below:




Copyright © Windows knowledge All Rights Reserved