

You can have the debugger break when a variable changes its value. You can set your breakpoint to break when expression evaluates to true. With the help of expression evaluation, the debugger also supports conditional breakpoint. The Debugger for Java supports various breakpoints, such as line breakpoints, conditional breakpoints, data breakpoints, logpoints.

You can also use the user setting to configure a global console for all Java debug sessions. If your program need inputs from a terminal, you can use the Integrated Terminal ( ⌃` (Windows, Linux Ctrl+`)) within VS Code or an external terminal to launch it. The default Debug Console in VS Code doesn't support inputs. In addition to support for debugging Java projects managed by build tools, VS Code also supports for debugging single Java files without any project. You can also start a debugging session from the Run and Debug view from the side bar of VS Code. Pressing F5, the debugger will automatically find the entry point of your project and start debugging. You will find Run|Debug on the CodeLens of your main() function.Īnother way to start debugging is to select Run Java or Debug Java menu from the top editor title bar. The debugger extension provides multiple ways to run and debug your Java application. vscode folder in your workspace (project root folder).įor more details on how to create the launch.json, read Launch configurations for more details on configuration options for Java, you can read Configuration options. If you would like to customize and persist your launch configuration, you can select the create a launch.json file link in the Run and Debug view.

Configureīy default, the debugger will run out-of-box by automatically finding the main class and generating a default launch configuration in memory to launch your application.

To get the complete Java language support in Visual Studio Code, you can install the Extension Pack for Java, which includes the Debugger for Java extension.įor details on how to get started with the extension pack, you can review the Getting Started with Java tutorial. If you run into any issues when using the features below, you can contact us by entering an issue. Java Debug Server for Visual Studio Code.The Java debugger is an open-source project, which welcomes contributors to collaborate through GitHub repositories: Here's a list of supported debugging features: It's a lightweight Java debugger based on Java Debug Server, which extends the Language Support for Java™ by Red Hat. Visual Studio Code allows you to debug Java applications through the Debugger for Java extension. Configure IntelliSense for cross-compiling.
