JDK environment variable configuration
After we download and install the JDK on the computer, the operation that needs to be performed is to configure the environment variables, so how to configure the environment variables, then take the win10 system as an example to share with you.
1. Find the bin directory of the JDK, and then copy the address of this directory. For example, mine is installed on the c drive by default, so the address I want to copy is C:\Program Files\Java\jdk-12.0.2\bin
2. Find this computer in the computer -> click the right mouse button -> Properties
3. Select advanced options
4. Click Environment Variables
5. Find Path
6. Click Edit
7. Click New and paste the previously copied address, and finally click OK. We have completed the JDK environment variable configuration
8. Write a Java program
public class HelloWorld{
public static void main(String[] args)
{
System.out.print("Hello World!");
}
}
9. Windows+r–> enter cmd–>enter. 10. Here, because my program is saved in the Java folder of the D drive, we must first switch to the D drive and then find the Java folder, and then enter Javac HelloWorld, java (Javac HelloWorld, java is the name of the source program) compile the program, after the compilation is passed, enter Java Hello World to run the program, and the following is the result of our operation!