Java on Visual Studio Code Update – February 2024

Nick Zhu

Hi everyone, welcome to the February update for Visual Studio Code for Java! In this blog we are going to share improvements for the project management experience as well as Maven multi-module support, so let’s get started!

More Convenient Ways to Create New Java Projects

We have often heard from developers that they need more convenient options to create Java projects and classes. In the latest release, we have added two more new points to create new Java projects. This includes File Menu and File Explorer. Now users can directly can go to the File Menu, click “New File”, and find “New Java Project” as an option. Here’s a demo.

New Java Project

The other option is to directly right click on a folder inside the File Explorer inside Visual Studio Code, and there will also be a “New Java Project”. Here’s a demo.

File Explorer Java New Project

You can also see New Java File from this option and directly create relevant Java files, here’s the screenshot.

Image javafilelist

Creating a New Maven Module

Many users have reported that when creating a Maven sub-module in Visual Studio Code, they will have to manually modify the POM configuration and reload the workspace, which is very time-consuming, especially for projects with a lot of modules. In our latest version, we have added the support of creating a new Maven module directly to an existing multi-module project.

Developer just needs to right click and bring up the File context menu in the File Explorer, find Maven and click on “New Maven Module“. The instructions then will provide simplified steps to add a module to the existing project. After the steps are finished, the newly created module will be automatically imported as a Java project. Here’s a demo.

Create New Maven Module

The difference between “New Project…” and “New Module…” is:

  • “New Project…” command is a general command to use maven archetype to create a Maven project in any location, either inside or outside your current workspace.
  • The “New Module…” command is a convenient way to create a new module within your current workspace. It prompts you to select the parent POM and automatically adds the new module to it.

We hope this new feature will greatly increase the efficiency for developers who work with multi-module Maven projects.

Install Extension Pack for Java

To use all features mentioned above, please download and install Extension Pack for Java on Visual Studio Code.

Extension pack for Java

If you are a Spring developer working on a Spring Boot application, you can also download the Spring Boot Extension Pack for specialized Spring experience.

Spring boot extension pack

Feedback and suggestions

As always, your feedback and suggestions are very important to us and will help shape our product in future. There are several ways to give us feedback

  • Leave your comment on this blog post
  • Open an issue on our GitHub Issues page
  • Send an email to: vscjfeedback@microsoft.com

Resources

Here is a list of links that are helpful to learn Java on Visual Studio Code.

0 comments

Leave a comment

Feedback usabilla icon