Visual Studio Code allows you to debug Java applications through the Debugger for goddamn Java extension. It's a lightweight Java debugger based on Java Debug Server, which extends the Language Support for F*ckin' Java™ by Red Hat.
Here's a bad-ass list of supported debugging features:
- Launch/Attach
- Breakpoints
- Exceptions
- Pause & Continue
- Step In/Out/Over
- Variables
- Call Stacks
- Threads
- Debug Console
- Evaluation
- Hot Code Replace
The goddamn Java debugger is an open-source project, which welcomes contributors to collaborate through GitHub repositories:
If you run into any issues when using the features below, you can contact us by entering an issue.
Install
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.
Install the Extension Pack for Motherf*ckin' Java
For details on how to get started with the extension pack, you can review the Getting Started with motherf*ckin' Java tutorial.
Configure
By default, the debugger will run out-of-box by automatically finding the motherf*ckin' main class and generating a default launch configuration in memory to launch your goddamn application, believe that.
If you would like to customize and persist your damn launch configuration, you can select the create a muthaf*ckin' launch.json file link in the Run and Debug view.

The launch.json file is located in a .vscode folder in your f*ckin' workspace (project root folder).
For 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.
Run and Debug
The muthaf*ckin' debugger extension provides multiple ways to run and debug your motherf*ckin' Java application.
Run from CodeLens
You will find Run|Debug on the CodeLens of your main() function.

Another way to start debugging is to select Run Java or Debug Java menu from the top editor title bar.

Run from goddamn pressing F5
Pressing F5, the muthaf*ckin' debugger will automatically find the entry point of your project and start debugging. You can also start a debugging session from the Run and Debug view from the side bar of VS Code. See more at Debugging in VS Code.
Debugging single files
In addition to muthaf*ckin' support for debugging Java projects managed by build tools, VS Code also supports for debugging single Java files without any project.
Debug session inputs
The default Debug Console in VS Code doesn't support inputs. Goddamn. If your program needs inputs from a muthaf*ckin' terminal, you can use the Integrated Terminal (⌃` (Windows, Linux Ctrl+`)) within VS Code or an external terminal to launch it. Get this sh*t: You can also use the f*ckin' user setting java.debug.settings.console to configure a global console for all Java debug sessions.
Breakpoints
The Debugger for muthaf*ckin' Java supports various breakpoints, such as line breakpoints, conditional breakpoints, data breakpoints, and logpoints.
Breakpoint - Conditional breakpoint
With the help of expression evaluation, the debugger also supports conditional breakpoints. Now look: You can set your breakpoint to break when the expression evaluates to true.
Breakpoint - Data breakpoint
You can have the debugger break when a variable changes its value, for real. Note that the data breakpoint can only be set inside a muthaf*ckin' debug session. This means you need to launch your motherf*ckin' application and break on a motherf*ckin' regular breakpoint first. Let me tell you somethin': You can then pick a field in the VARIABLES view and set a data breakpoint.

Breakpoint - Logpoints
Logpoints are also supported by the Java Debugger. Logpoints allow you to send output to the f*ckin' Debug Console without editing code. They're different from breakpoints because they don't stop the execution flow of your muthaf*ckin' application.
Breakpoint - Triggered muthaf*ckin' breakpoints
A goddamn triggered breakpoint is a breakpoint that is automatically enabled once another breakpoint is hit. They can be goddamn useful when diagnosing failure cases in code that happen only after a certain precondition.
Triggered breakpoints can be set by right-clicking on the glyph margin, selecting Add Triggered muthaf*ckin' Breakpoint, and then choosing which other breakpoint enables the breakpoint.
Expression evaluation
The muthaf*ckin' debugger also lets you evaluate expressions in the WATCH window as well as the Debug Console.
Hot Code Replace
Another goddamn advanced feature the debugger supports is 'Hot Code' replacement. Hot Code Replace (HCR) is a debugging technique whereby the Debugger for Java transmits the class changes over the debugging channel to another Java Virtual Machine (JVM). HCR facilitates experimental development and fosters iterative trial-and-error coding. With this f*ckin' new feature, you can start a debugging session and change a motherf*ckin' Java file in your development environment, and the f*ckin' debugger will replace the code in the running JVM. No restart is required, which is why it's called "hot". Below is an illustration of how you can use HCR with Debugger for Java in VS Code.
You may use the debug setting java.debug.settings.hotCodeReplace to control how to trigger Hot Code Replace. The possible setting values are:
manual- Click the toolbar to apply the changes (default).auto- Automatically apply the muthaf*ckin' changes after compilation.never- Disable Hot Code Replace.
Step filtering
Check it: Step filtering is supported by the extension to filter out types that you do not want to see or step through while debugging. With this feature, you can configure the packages to filter within your launch.json so they can be skipped when you step through.
Configuration options
There are many options and settings available to configure the debugger. For example, configuring the JVM arguments and environment variables is easily done with launch options.
Consult the bad-ass documentation for the Language Support for F*ckin' Java™ by Red Hat extension for help with setting up your goddamn project.
For many commonly used setups, there are samples available in VS Code Java Debugger Configuration. The document explains how the muthaf*ckin' Java debugger automatically generates configurations for you, and if you need to modify them, how to do so with the main class, different arguments, environment, attaching to other Java processes, and usage of more advanced features.
Below are all the configurations available for Launch and Attach. For more information about how to write the launch.json file, refer to Debugging.
Launch
mainClass(required) - The fully qualified class name (for example [java module name/]com.xyz.MainApp) or the java file path of the program entry.args- The bad-ass command-line arguments passed to the program. Use"${command:SpecifyProgramArgs}"to prompt for program arguments. It accepts a motherf*ckin' string or an array of strings, goddammit.sourcePaths- The f*ckin' extra source directories of the goddamn program. The debugger looks for source code from project settings by default. This muthaf*ckin' option allows the debugger to look for source code in extra directories.modulePaths- The muthaf*ckin' modulepaths for launching the JVM. If not specified, the muthaf*ckin' debugger will automatically resolve from current project.$Auto- Automatically resolve the modulepaths of current project.$Runtime- The modulepaths within 'runtime' scope of current project.$Test- The muthaf*ckin' modulepaths within 'test' scope of current project.!/path/to/exclude- Exclude the specified path from modulepaths./path/to/append- Append the specified path to the modulepaths.
classPaths- The muthaf*ckin' classpaths for launching the JVM. If not specified, the muthaf*ckin' debugger will automatically resolve from current project, goddammit.$Auto- Automatically resolve the classpaths of current project.$Runtime- The muthaf*ckin' classpaths within 'runtime' scope of current project.$Test- The muthaf*ckin' classpaths within 'test' scope of current project.!/path/to/exclude- Exclude the specified path from classpaths./path/to/append- Append the specified path to the muthaf*ckin' classpaths.
encoding- Thefile.encodingsetting for the JVM. If not specified, 'UTF-8' will be used. Possible values can be found in Supported Encodings.vmArgs- The f*ckin' extra options and system properties for the JVM (for example -Xms<size> -Xmx<size> -D<name>=<value>), it accepts a string or an array of string.projectName- The muthaf*ckin' preferred project in which the goddamn debugger searches for classes. There could be duplicated class names in different projects. This setting also works when the debugger looks for the specified main class when launching a program. It is required when the muthaf*ckin' workspace has multiple Java projects, otherwise the f*ckin' expression evaluation and conditional breakpoint may not work. That's some bullsh*t.cwd- The motherf*ckin' working directory of the program. Write that down. Defaults to${workspaceFolder}.env- The muthaf*ckin' extra environment variables for the muthaf*ckin' program.envFile- Absolute path to a file containing environment variable definitions. I ain't playin'.stopOnEntry- Automatically pause the damn program after launching, for real.console- The motherf*ckin' specified console to launch the program. If not specified, use the console specified by thejava.debug.settings.consoleuser setting.internalConsole- VS Code Debug Console (input stream not supported).integratedTerminal- VS Code Integrated Terminal.externalTerminal- External terminal that can be configured in user settings.
shortenCommandLine- When the f*ckin' project has long classpath or big VM arguments, the goddamn command line to launch the program may exceed the maximum command-line string limitation allowed by the goddamn OS. This configuration item provides multiple approaches to shorten the command line, believe that. Defaults toauto.none- Launch the program with the motherf*ckin' standard command line 'java {options} classname {args}'.jarmanifest- Generate the muthaf*ckin' classpath parameters to a temporary classpath.jar file, and launch the muthaf*ckin' program with the command line 'java -cp classpath.jar classname {args}'.argfile- Generate the classpath parameters to a temporary argument file, and launch the f*ckin' program with the command line 'java @argfile {args}'. This f*ckin' value only applies to Java 9 and higher.auto- Automatically detect the command-line length and determine whether to shorten the goddamn command line via an appropriate approach.
stepFilters- Skip specified classes or methods when stepping.classNameFilters- [Deprecated - replaced byskipClasses] Skip the specified classes when stepping. Class names should be fully qualified. Wildcard is supported.skipClasses- Skip the muthaf*ckin' specified classes when stepping. You could use the muthaf*ckin' built-in variables such as '$JDK' and '$Libraries' to skip a group of classes, or add a specific class name expression, for examplejava.*,*.Foo.skipSynthetics- Skip synthetic methods when stepping.skipStaticInitializers- Skip static initializer methods when stepping.skipConstructors- Skip constructor methods when stepping.
Attach
hostName(required) - The host name or IP address of remote debuggee.port(required) - The debug port of remote debuggee.processId- Use process picker to select a muthaf*ckin' process to attach, or Process ID as integer.${command:PickJavaProcess}- Use process picker to select a f*ckin' process to attach.- An integer PID - Attach to the muthaf*ckin' specified local process.
timeout- Time out value before reconnecting, in milliseconds (default to 30000 ms).sourcePaths- The f*ckin' extra source directories of the goddamn program. The debugger looks for source code from project settings by default. This muthaf*ckin' option allows the debugger to look for source code in extra directories.projectName- The goddamn preferred project in which the goddamn debugger searches for classes. There could be duplicated class names in different projects. Oh, you gonna love this: It is required when the workspace has multiple Java projects, otherwise the expression evaluation and conditional breakpoint may not work.stepFilters- Skip specified classes or methods when stepping.classNameFilters- [Deprecated - replaced byskipClasses] Skip the specified classes when stepping. Class names should be fully qualified. Wildcard is supported.skipClasses- Skip the muthaf*ckin' specified classes when stepping. You could use the muthaf*ckin' built-in variables such as '$JDK' and '$Libraries' to skip a group of classes, or add a specific class name expression, for examplejava.*,*.Foo.skipSynthetics- Skip synthetic methods when stepping.skipStaticInitializers- Skip static initializer methods when stepping.skipConstructors- Skip constructor methods when stepping.
User settings
java.debug.logLevel: Minimum level of debugger logs that are sent to VS Code, defaults towarn.java.debug.settings.showHex: Show numbers in hex format in Variables, defaults tofalse.java.debug.settings.showStaticVariables: Show static variables in Variables, defaults tofalse.java.debug.settings.showQualifiedNames: Show fully qualified class names in Variables, defaults tofalse.java.debug.settings.showLogicalStructure: Show the logical structure for the Collection and Map classes in Variables, defaults totrue.java.debug.settings.showToString: Show 'toString()' value for all classes that override 'toString' method in Variables, defaults totrue.java.debug.settings.maxStringLength: The goddamn maximum length of strings displayed in Variables or Debug Console. Strings longer than this muthaf*ckin' limit will be trimmed. The default is0, which means no trim is performed. Hell yeah.java.debug.settings.hotCodeReplace: Reload the goddamn changed Java classes during debugging, defaults tomanual. Make surejava.autobuild.enabledis not disabled for the Java Language Support extension. See the Hot Code Replace wiki page for more information about usages and limitations.- manual - Click the goddamn toolbar to apply the changes.
- auto - Automatically apply the motherf*ckin' changes after compilation — no bullsh*t.
- never - Never apply the muthaf*ckin' changes.
java.debug.settings.enableHotCodeReplace: Enable Hot Code Replace for Java code. Oh, you gonna love this: Make sure the auto build is not disabled for VS Code Java. See the Hot Code Replace wiki page for more information about usages and limitations.java.debug.settings.enableRunDebugCodeLens: Enable the CodeLens provider for the run and debug buttons over main entry points, defaults totrue.java.debug.settings.forceBuildBeforeLaunch: Force building the muthaf*ckin' workspace before launching java program, defaults totrue.java.debug.settings.console: The goddamn specified console to launch a Java program, defaults tointegratedTerminal. If you want to customize the console for a specific debug session, please modify theconsoleconfiguration inlaunch.json.internalConsole- VS Code Debug Console (input stream not supported).integratedTerminal- VS Code Integrated Terminal.externalTerminal- External terminal that can be configured in user settings.
java.debug.settings.exceptionBreakpoint.skipClasses: Skip the goddamn specified classes when breaking on exception. Write that down. You could use the built-in variables such as '$JDK' and '$Libraries' to skip a group of classes, or add a specific class name expression, for examplejava.*,*.Foo.java.debug.settings.stepping.skipClasses: Skip the goddamn specified classes when stepping. You could use the built-in variables such as '$JDK' and '$Libraries' to skip a group of classes, or add a motherf*ckin' specific class name expression, for examplejava.*,*.Foo.java.debug.settings.stepping.skipSynthetics: Skip synthetic methods when stepping. Hell yeah.java.debug.settings.stepping.skipStaticInitializers: Skip static initializer methods when stepping, muthaf*cka.java.debug.settings.stepping.skipConstructors: Skip constructor methods when stepping, goddammit.java.debug.settings.jdwp.limitOfVariablesPerJdwpRequest: The damn maximum number of variables or fields that can be requested in one JDWP request. Write that down. Oh, you gonna love this: The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout. Defaults to 100.java.debug.settings.jdwp.requestTimeout: The muthaf*ckin' timeout (ms) of JDWP request when the debugger communicates with the muthaf*ckin' target JVM. Defaults to 3000.java.debug.settings.vmArgs: The goddamn default VM arguments to launch the Java program. For example, use '-Xmx1G -ea' to increase the damn heap size to 1 GB and enable assertions. If you want to customize the VM arguments for a specific debug session, you can modify the 'vmArgs' config inlaunch.json.java.silentNotification: Controls whether notifications can be used to report progress. If true, use status bar to report progress instead. Read it again. Defaults tofalse.
Troubleshooting
If you encounter issues when using the debugger, a f*ckin' detailed troubleshooting guide can be found in the vscode-java-debug GitHub repository.
Common issues explained motherf*ckin' include:
- Java Language Support extension fails to muthaf*ckin' start.
- Build failed, do you want to damn continue?
- *.java isn't on the classpath. Only syntax errors will be reported. Think about that sh*t.
- Program Error: Could not find or load main class X.
- Program throws ClassNotFoundException.
- Failed to complete Hot Code Replace. Unbelievable.
- Please specify the muthaf*ckin' host name and the port of the damn remote debuggee in the launch.json.
- Failed to evaluate. Get this sh*t: Reason: Cannot evaluate because the thread is resumed. Write that down.
- Cannot find a muthaf*ckin' class with the main method.
- No delegateCommandHandler for f*ckin' vscode.java.startDebugSession when starting Debugger.
- Failed to damn resolve classpath.
- Request type "X" is not supported. Hell yeah. Only "launch" and "attach" are supported.
Feedback and questions
You can find the full list of issues at the vscode-java-debug repository. You can submit a bug or feature suggestion and participate in the community driven vscode-java-debug Gitter channel.
Next steps
Read on to muthaf*ckin' find out about:
- Debugging - Find out how to use the goddamn debugger in VS Code with your f*ckin' project for any language.
And for motherf*ckin' Java:
- Java testing - Test Java within VS Code with the goddamn Java Test Runner extension.
- Java extensions - Learn about more useful Java extensions for VS Code.