Quickstart: Using VS Code with Java and Maven projects
Java is one of many languages supported by Visual Studio Code (VS Code). Like most things in VS Code, Java support is extension based. You may need several extensions, depending on the project type and stack you are working with. You can find more detail in Java in Visual Studio Code in the official VS Code documentation.
Fortunately, getting started is simple and you’ll probably already be familiar with most of the things.
This installs the most essential extensions for Java support. In many cases, it’s all you need. You can install the pack manually, or in response to the automatic prompt that displays when you first open a Java file.
Download a starter project from start.vaadin.com (or use an existing project), extract it into a folder, and then use Open Folder in VS Code to open the project. VS Code automatically recognizes that it is a Maven-based Java project and opens the Java Overview.
Your project is now ready to run (and develop). You can use the Maven Projects panel to run a goal, or you can open a terminal (select Terminal>New Terminal) and run commands in your project folder.
You may find that VS Code works similarly to what you are already used to. For instance, you can hover over a type to see more information; use CTRL/CMD+hover for more, and CTRL/CMD+click to navigate to the type.
Use F5 (or select Debug >Start Debugging) to start debugging. The first time you do this, VS Code automatically generates a launch configuration for you, and you have to select Start Debugging again to actually start the process. Once your application has started, you will find the usual debugging tools in the Debug view; for example, clicking to the left of the row number adds a breakpoint and so on.
Visual Studio Code is an advanced IDE with many convenient tricks up its sleeve. Take a look at the official documentation, and in particular the Writing Java with VS Code section that includes information about editing, running, debugging, and so on. There is also a section on Maven support in VS Code.