JAVA simple programming

How to use the win7 system to install JDK and hit hellojava

2. Run the installation fileDouble-click the JDK installation package, pop-up installation prompt box, click the "Next" button, the installation interface appears. The system gives the default installation directory. If you want to specify another installation directory, you can click the "Change" button to modify the selection. Click the "Next" button to complete the installation.

3.JDK directory introduction After the JDK installation is completed, some subdirectories and files will be generated in the specified installation directory, as shown below. These subdirectories and files are helpful for subsequent development. 这里写图片描述

4.Configure environment variable path and classpath1) Configure environment variable path Step 1: Click on “My Computer”, select the “Properties” command from the shortcut menu, click the “Advanced Settings” link, select the “Advanced” tab in the “System Variables” dialog box that appears, and then click “Environment” The Variables button opens the Environment Variables dialog as shown. 这里写图片描述

Step 2: Select the "Path" variable in the "System Variables" area of ​​the "Environment Variables" dialog box, click the "Edit" button, in the "Edit System Variables" dialog box that opens, the bin directory The absolute path (such as "C:\Program Files\Java\jdk1.7.0_80\bin") is added to the front of the "Variable Value" text box, ending with a semicolon (;) in English, separated from the trailing path. Open as shown. Then click the "OK" button to complete the setup. 这里写图片描述

Step 3: Verify that the JDK environment is built successfully by the following methods. Click the "Start" button, type "cmd", press Enter to enter the console mode. Enter "javac" on the command line and press the Enter key. If the help file appears, as shown in the figure, the environment variable Path is successfully configured. 这里写图片描述

2)Configure environment variable classpath Click the Create button in the System Variables area of ​​the Environment Variables dialog box. In the Edit System Variables dialog box, add the absolute path to the directory where the class files are stored (for example, "F:\mywork"). Variable Value text box. It is best to add "." in front and separate them with ";" as shown. 这里写图片描述 然后依次单击“确定”按钮,完成设置。

**Run java program 1) Editing program Java programs can be edited with a text editing tool such as Notepad. For example, in the directory F; \mywork, create a text file HelloWorld, java (the file extension should be changed to "java" instead of the default "txt"), open the file through Notepad, write as shown Code, save the file. 这里写图片描述

2) Compiler as the picture shows.这里写图片描述