Go to file
Jinbo Wang 0e86ed2cc7
Add a troubleshooting page for the frequently asked errors (#341)
* Add a troubleshooting page for the frequently asked errors

* Update the wrong link and remove the unnecessary separator

* Update Troubleshooting.md

* Make tslint happy

* Refine the words per review

* Add the missing items parameter for showErrorMessage function

* Log the troubleshooting usage

* Add a reference in README to link to troubleshooting page

* Update the fix steps for illegal request type error

* Refine the description words for differnt errors

* Add jdk troubleshooting item

* Add a link to submit an issue

* Add compilation as a try step for ClassNotFoundException

* Add the missing license header

* Resolve the review comments for troubleshooting doc

* Extract dup code to a helper function

* Merge activation event to usage data

* Refactor showMessage utility method

* Add opn to dependency list

* update package-lock.json
2018-08-01 14:35:48 +08:00
.github Add issue template. (#162) 2017-11-17 11:28:32 +08:00
.vscode Add project scope when resolving multiple-root project. (#174) 2017-11-22 14:03:06 +08:00
images check in test plan (#340) 2018-07-18 13:59:30 +08:00
scripts fix the ci error of https://travis-ci.org/Microsoft/vscode-java-debug… (#312) 2018-06-19 14:31:13 +08:00
src Add a troubleshooting page for the frequently asked errors (#341) 2018-08-01 14:35:48 +08:00
test Enable travis (#84) 2017-10-10 12:42:23 +08:00
testprojects check in test plan (#340) 2018-07-18 13:59:30 +08:00
.editorconfig Refine codebase. (#13) 2017-09-17 19:47:07 -07:00
.gitignore fix the ci error of https://travis-ci.org/Microsoft/vscode-java-debug… (#312) 2018-06-19 14:31:13 +08:00
.travis.yml update travis to get rid of gulp3 issue on node 10 (#290) 2018-04-26 10:47:10 +08:00
.vscodeignore check in test plan (#340) 2018-07-18 13:59:30 +08:00
CHANGELOG.md Update CHANGELOG.md (#320) 2018-06-27 10:46:51 +08:00
LICENSE.txt Update license. (#42) 2017-09-22 13:16:06 +08:00
README.md Add a troubleshooting page for the frequently asked errors (#341) 2018-08-01 14:35:48 +08:00
TestPlan.md update test plan for new launch.json generation UX (#343) 2018-07-26 00:28:15 +08:00
Troubleshooting.md Add a troubleshooting page for the frequently asked errors (#341) 2018-08-01 14:35:48 +08:00
gulpfile.js Fix gulp build_server location isue. (#138) 2017-11-08 13:44:51 +08:00
logo.png Update product icon (#25) 2017-09-20 16:24:51 +08:00
package-lock.json Add a troubleshooting page for the frequently asked errors (#341) 2018-08-01 14:35:48 +08:00
package.json Add a troubleshooting page for the frequently asked errors (#341) 2018-08-01 14:35:48 +08:00
tsconfig.json Fixing the versions in package.json and modify the tslint configuration to fix the issue in gulp tslint/ 2017-10-24 17:32:34 +08:00
tslint.json Fixing the versions in package.json and modify the tslint configuration to fix the issue in gulp tslint/ 2017-10-24 17:32:34 +08:00

README.md

Debugger for Java

Gitter Travis CI

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

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)
  • Open a Java file to activate the extensions
  • Add debug configurations and edit launch.json
    • To launch: specify mainClass
    • To attach: specify hostName and port
  • Press F5

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

Options

Launch

  • mainClass (required) - The main class of the program (fully qualified name, e.g. [mymodule/]com.xyz.MainClass).
  • args - The command line arguments passed to the program. Use "${command:SpecifyProgramArgs}" to prompt for program arguments.
  • 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.
  • classPaths - The classpaths for launching the JVM. If not specified, the debugger will automatically resolve from current project.
  • encoding - The file.encoding setting for the JVM. If not specified, 'UTF-8' will be used. Possible values can be found in http://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<size> -Xmx<size> -D<name>=<value>).
  • 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.
  • env - The extra environment variables for the program.
  • stopOnEntry - Automatically pause the program after launching.
  • console - The specified console to launch the program. Defaults to internalConsole.
    • internalConsole - VS Code debug console (input stream not supported).
    • integratedTerminal - VS Code integrated terminal.
    • externalTerminal - External terminal that can be configured in user settings.
  • stepFilters - Skip specified classes or methods when stepping.
    • classNameFilters - Skip the specified classes when stepping. Class names should be fully qualified. Wildcard is supported.
    • 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.
  • timeout - Timeout value before reconnecting, in milliseconds (default to 30000ms).
  • 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.
  • projectName - The preferred project in which the debugger searches for classes. There could be duplicated class names in different projects. 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 - Skip the specified classes when stepping. Class names should be fully qualified. Wildcard is supported.
    • 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 to warn.
  • java.debug.settings.showHex: show numbers in hex format in "Variables" viewlet, defaults to false.
  • java.debug.settings.showStaticVariables: show static variables in "Variables" viewlet, defaults to true.
  • java.debug.settings.showQualifiedNames: show fully qualified class names in "Variables" viewlet, defaults to false.
  • java.debug.settings.maxStringLength: the maximum length of string displayed in "Variables" or "Debug Console" viewlet, the string longer than this length will be trimmed, defaults to 0 which means no trim is performed.
  • java.debug.settings.enableHotCodeReplace: enable hot code replace for Java code. Make sure the auto build is not disabled for VSCode Java. See the wiki page for more information about usages and limitations.

Troubleshooting

Reference the troubleshooting guide for common errors.

Feedback and Questions

You can find the full list of issues at Issue Tracker. You can submit a bug or feature suggestion, and participate community driven Gitter

License

This extension is licensed under MIT License.

Data/Telemetry

VS Code collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. If you don't wish to send usage data to Microsoft, you can set the telemetry.enableTelemetry setting to false. Learn more in our FAQ.