RepoMicrosoftMicrosoftpublished Sep 6, 2017seen 2d

microsoft/vscode-java-debug

TypeScript

Open original ↗

Captured source

source ↗
published Sep 6, 2017seen 2dcaptured 10hhttp 200method plain

microsoft/vscode-java-debug

Description: Java Debugger for Visual Studio Code.

Language: TypeScript

License: NOASSERTION

Stars: 587

Forks: 419

Open issues: 203

Created: 2017-09-06T08:40:42Z

Pushed: 2026-06-10T02:42:12Z

Default branch: main

Fork: no

Archived: no

README:

Debugger for Java

![Gitter](https://gitter.im/Microsoft/vscode-java-debug)

Overview

A lightweight Java Debugger based on Java Debug Server which extends the Language Support for Java by Red Hat. It allows users to debug Java code using Visual Studio Code (VS Code). Here's a list of features:

  • Launch/Attach
  • Breakpoints/Conditional Breakpoints/Logpoints
  • Exceptions
  • Pause & Continue
  • Step In/Out/Over
  • Variables
  • Callstacks
  • Threads
  • Debug console
  • Evaluation
  • Hot Code Replace
  • No-Config Debug (debug Java apps without launch.json)
  • [AI] AI-Assisted Debugging (GitHub Copilot integration)

Requirements

Install

Open VS Code and press F1 or Ctrl + Shift + P to open command palette, select Install Extension and type vscode-java-debug.

Or launch VS Code Quick Open (Ctrl + P), paste the following command, and press enter.

ext install vscode-java-debug

Use

  • Launch VS Code
  • Open a Java project (Maven/Gradle/Eclipse/Single Java file)
  • Open a Java file to activate the extensions
  • Press F5

Please also check the documentation of Language Support for Java by Red Hat if you have trouble setting up your project.

No-Config Debug

You can now debug Java applications without creating a launch.json file! Simply open a terminal in VS Code and use the debugjava command:

# Debug a main class
debugjava -cp bin com.example.Main

# Debug a JAR file
debugjava -jar target/myapp.jar

# Debug with arguments
debugjava -cp bin com.example.Main arg1 arg2

The debugger will automatically attach. See [No-Config Debug Documentation](bundled/scripts/noConfigScripts/README.md) for more details.

AI-Assisted Debugging

When using GitHub Copilot Chat, you can now ask AI to help you debug Java applications! The extension provides a Language Model Tool that enables natural language debugging:

  • "Debug my Spring Boot application"
  • "Debug the Main class in this project"
  • "Debug Calculator with arguments 10 and 5"

The AI will automatically: 1. Detect your project type (Maven/Gradle/VS Code) 2. Build/compile your project 3. Start debugging with appropriate configuration

See [Language Model Tool Documentation](bundled/agents/README.md) for more details.

Options

Launch

  • mainClass - The fully qualified name of the class containing the main method. If not specified, the debugger automatically resolves the possible main class from current project.
  • ${file} - Current Java file.
  • com.mypackage.Main - The fully qualified class name.
  • com.java9.mymodule/com.mypackage.Main - The fully qualified module name and class name.
  • /path/to/Main.java - The file path of the main class.
  • args - The command line arguments passed to the program.
  • "${command:SpecifyProgramArgs}" - Prompt user for program arguments.
  • A space-separated string or an array of string.
  • sourcePaths - The extra source directories of the program. The debugger looks for source code from project settings by default. This option allows the debugger to look for source code in extra directories.
  • modulePaths - The modulepaths for launching the JVM. If not specified, the debugger will automatically resolve from current project. If multiple values are specified, the debugger will merge them together.
  • $Auto - Automatically resolve the modulepaths of current project.
  • $Runtime - The modulepaths within 'runtime' scope of current project.
  • $Test - The 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 classpaths for launching the JVM. If not specified, the debugger will automatically resolve from current project. If multiple values are specified, the debugger will merge them together.
  • $Auto - Automatically resolve the classpaths of current project.
  • $Runtime - The classpaths within 'runtime' scope of current project.
  • $Test - The 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 classpaths.
  • encoding - The file.encoding setting for the JVM. Possible values can be found in https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html.
  • vmArgs - The extra options and system properties for the JVM (e.g. -Xms\ -Xmx\ -D\=\), it accepts a string or an array of string.
  • projectName - The preferred project in which the 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 workspace has multiple java projects, otherwise the expression evaluation and conditional breakpoint may not work.
  • cwd - The working directory of the program. Defaults to ${workspaceFolder}.
  • env - The extra environment variables for the program.
  • envFile - Absolute path to a file containing environment variable definitions. Multiple files can be specified by providing an array of absolute paths
  • stopOnEntry - Automatically pause the program after launching.
  • console - The specified console to launch the program. If not specified, use the console specified by the java.debug.settings.console user 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 project has long classpath or big VM arguments, the command line to launch the program may exceed the maximum command line string…

Excerpt shown — open the source for the full document.