Hot Code Replacement for Java comes to Visual Studio Code

Xiaokai He

Hot code replacement (HCR), which doesn’t require a restart, is a fast debugging technique in which the Java debugger transmits new class files over the debugging channel to another JVM. With this new feature in Visual Studio Code (VS Code), you can start a debugging session and change a Java file in your development environment, and the debugger will replace the code in the JVM running your code. This is the faster and easier way in Java to facilitate experimental development and to foster iterative trial-and-error coding. Below is an illustration of how you can use HCR with Debugger for Java in Visual Studio Code.

Hot Code Replacement for Java in Visual Studio Code

HCR only works when the class signature does not change; you cannot remove or add fields to existing classes, when using HCR. However, HCR can be used to change the body of a method.

Since announcing several new extensions for Java on VS Code in our last blog post, we’ve further enhanced our updates to those extensions to provide a better editing experience for Java developers using VS Code.

Java Test Runner

We have added a few new features to better support JUnit in VS Code.

  1. Added test explorer so now you can view and locate all tests from within the test explorer
  2. Added status bar item to show test status and statistics.
  3. Added command to show test output window, by default it won’t be opened while running tests.

Java Test Runner

Tomcat

With the updated Tomcat extension, you can now create new Tomcat server from server explorer using the newly added “Add” button and run war package on it. You can also create the server during the deployment.

Create new Tomcat Server

Checkstyle

In our latest release of Checkstyle extension, properties in the Checkstyle configuration file get automatically resolved, which makes it easier for you to edit the configuration.

Properties in Checkstyle configuration file get automatically resolved

Please also refer to Checkstyle extension home page to view all the convenient commands that you can use to configure your Checkstyle.

Maven

We’ve also released our latest Maven extension under Microsoft. The new release brings new support to use maven wrapper as executable. The Maven wrapper is widely used to provide a fully encapsulated build setup for the project.

Try it out

Please don’t hesitate to have a try using VS Code, a lightweight code editor, for your Java development and let us know your feedback!

0 comments

Discussion is closed.

Feedback usabilla icon