Kotlin Visual Studio Code
Visual Studio Code is an ideal lightweight development environment for Spring Boot application developers and there are several useful VS Code extensions including:
- While in this How-To I showed you how to use Gradle for Kotlin/Native on a Mac, the dependency on Visual Studio Code is still quite low. At this time, we use VSC solely for writing code and the Gradle settings. We also have some help on hand, like syntax highlighting and some code completion.
- Android Studio; Visual Studio for Mac; Java Decompiler; Build a native library. The first step is to build a native Kotlin library using Android Studio. The library is usually provided by a third-party developer or available at the Google's Maven repository and other remote repositories. As an example, in this tutorial a binding for the Bubble.
If you run into any issues when using the features below, you can contact us by clicking the Report an issue button below.
Prerequisites
A working Java environment with essential extensions installed is needed, including:
To install, launch VS Code and from the Extensions view (⇧⌘X (Windows, Linux Ctrl+Shift+X)), search for vscode-spring-initializr. Once you have the extension installed, open the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) and type Spring Initializr to start generating a Maven or Gradle project and then follow the wizard. Edit the project.
- Java Development Kit (JDK), version 11 or later.
- Apache Maven, version 3.0 or later.
For more details, please refer to Java Tutorial
Note: More information about JDK can be found at supported Java versions.
Create the project
The Spring Initializr extension allows you to search for dependencies and generate new Spring Boot projects.
To install, launch VS Code and from the Extensions view (⇧⌘X (Windows, Linux Ctrl+Shift+X)), search for vscode-spring-initializr
.
Once you have the extension installed, open the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) and type Spring Initializr
to start generating a Maven or Gradle project and then follow the wizard.
Edit the project

The Spring Initializr extension allows you to edit dependencies after generating a new Spring Boot project.
Navigate to your pom.xml
file and right-click to select Edit starters
. The Command Palette will show the dependencies you already have beginning with a √
. You can search for other dependencies you want to add to your project. Or you can click on the existing dependencies to remove them.
Develop the application
The Spring Boot Tools extension includes rich language support for working with Spring Boot application.properties
, application.yml
, and .java
files.
The extension supports quick navigate through source code, smart code completions, quick access to running apps, live application information, and code templates. Similar code completion and validation features are also available for .properties
and .yml
files.
Run the application
In addition to click F5 to run your application, there's another convenient extension Spring Boot Dashboard with which you can view and manage all available Spring Boot projects in your workspace as well as quickly start, stop, or debug your project.
Next steps
- To deploy your web app, see the Deploy a Java Application to Azure tutorial.
- To containerize a web app and deploy as a Docker container, check out the Working with Docker.
- To learn more about Java Debugging features, see Java Debugging Tutorial.
This document will give you an overview of how work with your Java build tools in Visual Studio Code. It covers the Maven for Java extension as well as other tools.
If you run into any issues when using the features below, you can contact us by clicking the Report an issue button below.
Maven
Maven is a software tool that helps you manage Java projects and automate application builds. The Maven for Java extension for Visual Studio Code provides fully integrated Maven support, allowing you to explore Maven projects, execute Maven commands, and perform the goals of build lifecycle and plugins.

Exploring Maven project
Once a Maven project is loaded, the extension will be activated and it will automatically scan for pom.xml
files in your workspace and displays all Maven projects and their modules in the side bar.
Resolve unknown type
The Maven extension also supports searching Maven Central to resolve unknown types in your source code. You can do this by selecting the Resolve unknown type link shown on hover.
Working with POM.xml
The extension provides code snippets and auto completion for adding Maven dependencies based on local Maven repositories. See how easy it is to add a new dependency to your pom.xml
with those convenient features.
Create Kotlin Project In Visual Studio Code


The extension also enables you to generate effective POM.
You can also use the command Maven: Add a Dependency (or maven.project.addDependency
) to help add a new dependency to pom.xml
. The process is interactive.
You can also add dependencies through the project view, which calls the same Maven command.
Furthermore, VS Code also supports showing dependencies in a tree view, which allows you to inspect all dependencies in your project at a single place and check for potential issues.
Execute Maven commands and goals
By right-clicking each Maven project in the explorer, you can conveniently run Maven goals.
The extension also preserves the history of goals for each project, so you can quickly rerun the previous command, which is useful when you're running a long custom goal.
There are two ways to rerun a goal:
Visual Studio Code For Beginners
- Command Palette > Select Maven: History > Select a project > Select command from the history.
- Right-click a project > Click History > Select command from history.
You can also specify your favorite commands in settings for future execution.
For each plug-in you use with your project, the extension also provides you an easy way to access the goals within each plugin.

To debug Maven goals, right-click on a goal and start debugging. The Maven extension will call the Java debugger with the right parameters. This is a handy, time-saving feature.
Generate project from Maven Archetype
Another handy feature provided by this extension is to generate a Maven project from Archetype. The extension loads archetypes listed in local/remote catalogs. After selection, the extension sends mvn archetype:generate -D...
to the terminal.
There are two ways to generate a Maven project:
- From the Command Palette, select Maven: Generate from Maven Archetype.
- Right-click on a folder and select Generate from Maven Archetype.
Gradle
VS Code supports basic Gradle Java project (not including Android). There are also a couple third party extensions available for writing .gradle
files as well as running Gradle tasks.
Additional resources
Visit the GitHub Repo of the Maven extension for additional configurations and a troubleshooting guide.
In addition to Maven, there's also a Bazel extension if you use Bazel to build and test your project.
Next steps
Read on to find out more about:
- Java Editing - Explore the editing features for Java in VS Code.
- Java Debugging - Find out how to debug your Java project with VS Code.
- Java Testing - Use VS Code for your JUnit and TestNG cases.
- Java Extensions - Learn about more useful Java extensions for VS Code.
