1. Install JDK and configure environment variables

1- Java development tools installation – JDK.

2.Java language extension pack – automatic completion

2.1. Install the Java language extension package

Search in the VSCode plug-in extensionJava, install the Java language support package, as shown in the figure below:

2.2. Test whether automatic completion can be performed

intest.javaFile to write code, you can see VSCode automatically prompt:



You can also see the Java language support pack plug-in running successfully in the status bar at the bottom right corner:

3. Compile and run the Java language on the cli

Used in VSCode’s integration terminaljavacandjavaCommand to compile and run:

4.Java Extension pack – One-click run and debug

4.1. Install the Java extension package

Search in the VSCode plug-in extensionJava, install the Java extension package, as shown in the figure below:

4.2. Test whether it can run and debug

4.2.1. Run the code

Click on theRunExecutable code:



Running results:

4.2.2. Debug code

Make a break point:

Click on theDebugStart debugging: