Java HelloWorld

1, download JDK

2, install JDK

double-click the downloaded executable file to install. Click Next to reach the following page 可更改安装地址也可不更改。一直点击下一步,直至安装完成。

3, configure the environment variable

to set 3 properties in the "system variables", JAVA_HOME, PATH, CLASSPATH (case does not matter), if it already exists, click "Edit", Click "New" if it does not exist.

Variable setting parameters are as follows:

 Variable name: JAVA_HOME
Variable value: C:\Program Files \Java\jdk-10.0.2
// To configure 

这里写图片描述

 variable name according to your actual path: CLASSPATH
Variable value: .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
 // Remember that there is a "." 

这里写图片描述

 variable name: Path
Variable value: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;

这里写图片描述

4, test whether jdk is installed successfully

In the command prompt, enter javajavacjava -version The following information appears to indicate successful installation 这里写图片描述

5, write helloworld

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}

Run results are as follows:这里写图片描述