Home >Development Tools >VSCode >Configuration method of Java development environment in VSCode

Configuration method of Java development environment in VSCode

青灯夜游
青灯夜游forward
2021-01-07 10:29:0612949browse

How to set up a Java development environment in

vscode? The following article will introduce to you how to configure the Java development environment with VSCode. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Configuration method of Java development environment in VSCode

Related recommendations: "vscode tutorial"

Configuring Java development environment

Mainly refer to the official tutorial: https ://code.visualstudio.com/docs/java/java-tutorial

1. Install JDK first

JDK download address: https://www.oracle.com/java/technologies /javase-downloads.html

2. Configuration variables

Configure JAVA environment variables: Reference https://www.cnblogs.com/happyAzhan/p /11271274.html;

3. Install Java Extension Pack

This Java Extension Pack is an integration of 6 extensions. You only need to install this one, which is very convenient.

Directly click the link: https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack or install it in the VScode extension

and you will be prompted:

Just choose to open it. Then just click install in VS Code.

3. Configure the jdk version of VS Code

Type in the VS Code interface: Ctrl Shift P, then enter: Java: Configure Java Runtime
As shown below:

Fill in the jdk path here

4. Start writing the Java program: Hello, world!

Then F5 can be run.

Naturally there will be the desired output.
If there is no output or an error is reported:
1) Confirm whether you have installed Java Extension Pack
2) Enter in the terminal below: java -versionConfirm Check if jdk is installed.

Remarks:

Press simultaneously on the VS Code interface: Ctrl Shift P, and then enter: Java: Getting Started You can see some tips about java development (shortcut keys and the like are still very friendly).

For more programming-related knowledge, please visit: Introduction to Programming! !

The above is the detailed content of Configuration method of Java development environment in VSCode. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete