Front understanding of the relationship between the JVM, JRE, JDK three, so as to develop our program to this JDK installation.
Official website to download installation package corresponding to the machine:
https://www.oracle.com/java/technologies/javase-downloads.html
Configuration environment variable:
1. After installation is complete, right-click "My Computer", click "Properties", select "Advanced System Settings";
2. Select the "Advanced" tab, click on the "Environment Variables";
Then the screen will appear as shown below:
Set three properties in the "System Variables", JAVA_HOME, PATH, CLASSPATH (capitalization does not matter), If there is already then click the "Edit" does not exist, click "New."
Variable is set to the following parameters:
- Variable name: JAVA_HOME
- Variable value: C: \ Program Files (x86) \ the Java \ jdk1.8.0_91 // to be configured according to their actual installation path
- Variable name: the CLASSPATH
- Variable values: ;.% JAVA_HOME% \ lib \ dt.jar;% JAVA_HOME% \ lib \ tools.jar; // in front of a recall. ""
-
Variable name: Path
-
Variable value: % JAVA_HOME% \ bin;% JAVA_HOME % \ jre \ bin; // win10 system, we need to% JAVA_HOME% \ bin;% JAVA_HOME % \ jre \ bin; adding separately
JDK is installed successfully test
public class Demo{ public static void main(String[] args){ System.out.println("hello world"); } }