June 28th, 2024

Java on Visual Studio Code Update – June 2024

Nick Zhu
Senior Program Manager

Hi everyone, welcome to the June update for Visual Studio Code for Java! In this blog we are going to share several user experience updates, as well as important Spring features improvements, so let’s get started!

Project Settings Page Enhancements

New Compiler Section

A new compiler section was added to the project settings page. This allows you to conveniently set Java compiler related options for your project. Currently the options include source and target compatibility, –release option for cross compilation and customization for class file generation. See the screenshot below for the compiler section.

Compiler

Maven Section

In addition to compiler sections, we have also added a Maven section so that developers can easily point to active Maven profiles. Developers just need to click on “Maven” and enter the Maven profile names.

Maven

Formatter Section

Finally, many developers need to use a formatter for their code. We have added a shortcut for using the formatter in the project section as well. After clicking on “Formatter”, Visual Studio Code Java will take the developer to the formatter view. If the developer does not have a formatter currently, Visual Studio Code Java will ask the developer to create a formatter directly. See the demo below.

Formatter

Easier access to project settings page

Since we introduced the updated project settings page, we have received positive feedback from the developers. Therefore, we have made the project settings page to be more accessible, now you can directly get to the page from status bar using Java status menu. See the screenshot below.

Status bar project page

To see all the features above, developer can either use the status bar mentioned above, or directly just use Command Palette and type Java: Open Project Settings.

Testing Coverage

We have a new video that talks about how to use the new Testing Coverage features in Visual Studio Code Java. This allows Java developers to easily run tests with coverage in Visual Studio Code. Check this video out.

Build Server for Gradle Google Summer Projects

We are excited to share that Google summer of Code projects are now announced, and you can find the details in the Gradle Build Tools newsletter here. This year the Visual Studio Code Java team is mentoring two projects for Build Server for Gradle.

We’ll share more updates later about these projects and we welcome contributions for the Gradle Build Server from the community at any time.

Spring Feature Updates

There are also several nice Spring feature improvements. To use the features mentioned below, please install Spring Boot Extension Pack.

Support for @DependsOn

Support for the @DependsOn annotation has been added, which allows navigation to referenced beans as well as content-assist to quick define which beans the component depends on. See the demo below.

depends on support

Validation for JPQL and HQL queries

JPQL and HQL query strings used in @Query annotations are now validated as part of the regular reconciling so easily spot errors in those queries. As with all Spring specific validations, users can define the severity of those validations via preferences. See the demo below. hql syntax

Upgrade support for Spring Boot 3.3

The integrated support for upgrade Spring Boot projects to the latest Spring Boot version (using OpenRewrite) has been updated to include upgrades to Spring Boot 3.3.

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.

Author

Nick Zhu
Senior Program Manager

Developer at heart

1 comment

Discussion is closed. Login to edit/delete existing comments.

  • m aa

    🥰