VisualStudioCode的Java调试器

  • A2_275321
    了解作者
  • 16.4MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-04 06:43
    上传日期
Visual Studio Code的Java调试器
VisualStudioCode的Java调试器.zip
内容介绍
# Debugger for Java [![Gitter](https://badges.gitter.im/Microsoft/vscode-java-debug.svg)](https://gitter.im/Microsoft/vscode-java-debug) [![Travis CI](https://travis-ci.org/Microsoft/vscode-java-debug.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-java-debug) ## Overview A lightweight Java Debugger based on [Java Debug Server](https://github.com/Microsoft/java-debug) which extends the [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java). 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 - JDK (version 1.8.0 or later) - VS Code (version 1.19.0 or later) - [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) (version 0.14.0 or later) ## 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. ```bash 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](https://marketplace.visualstudio.com/items?itemName=redhat.java) if you have trouble setting up your project. ## Options ### Launch - `mainClass` (required) - The fully qualified class name (e.g. [java module name/]com.xyz.MainApp) or the java file path of the program entry. - `args` - The command line arguments passed to the program. Use `"${command:SpecifyProgramArgs}"` to prompt for program arguments. It accepts a 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. - `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\>), 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. - `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 limitation allowed by the OS. This configuration item provides multiple approaches to shorten the command line. Defaults to `auto`. - `none` - Launch the program with the standard command line 'java [options] classname [args]'. - `jarmanifest` - Generate the classpath parameters to a temporary classpath.jar file, and launch the program with the command line 'java -cp classpath.jar classname [args]'. - `argfile` - Generate the classpath parameters to a temporary argument file, and launch the program with the command line 'java @argfile [args]'. This value only applies to Java 9 and higher. - `auto` - Automatically detect the command line length and determine whether to shorten the command line via an appropriate approach. - `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 `false`. - `java.debug.settings.showQualifiedNames`: show fully qualified class names in "Variables" viewlet, defaults to `false`. - `java.debug.settings.showLogicalStructure`: show the logical structure for the Collection and Map classes in "Variables" viewlet, defaults to `true`. - `java.debug.settings.showToString`: show 'toString()' value for all classes that override 'toString' method in "Variables" viewlet, defaults to `true`. - `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.hotCodeReplace`: Reload the changed Java classes during debugging, defaults to `manual`. Make sure `java.autobuild.enabled` is not disabled for [VSCode Java](https://github.com/redhat-developer/vscode-java). See the [wiki page](https://github.com/Microsoft/vscode-java-debug/wiki/Hot-Code-Replace) for more information about usages and limitations. - manual - Click the toolbar to apply the changes. - auto - Automatically apply the changes after compilation. - never - Never apply the changes. - `java.debug.settings.enableRunDebugCodeLens`: enable the code lens provider for the run and debug buttons over main entry points, defaults to `true
评论
    相关推荐
    • Visual Studio主题
      Visual Studio主题,很喜欢的一款主题,。。。。。。。
    • Visual Studio 2010 SP1
      如果您在同一台计算机上安装多个版本的 Visual Studio 2010,程序二进制文件的组合可能会运行 Visual Studio 的同一实例中。例如,Visual Studio 2010 终极有 Microsoft Visual Basic 速成版 Service Pack 1 安装在...
    • Visual Studio Addin
      Visual Studio 数据库插件,可以用于操作物理表. 支持Visual Studio 2005 - 2012
    • visual studio assistant
      最新版本的visual studio assistant,能在开发环境中对你的开发提供输入提示,免去很多不必要的查找
    • VisualStudio
      VisualStudio
    • visual studio assist
      visual studio助手,包含两个版本,一个可以用于vs2010;另一个是助手的早期版本。
    • visualstudio
      visualstudio
    • VisualStudio
      VisualStudio
    • Visual Studio 2010 SP1
      如果您在同一台计算机上安装多个版本的 Visual Studio 2010,程序二进制文件的组合可能会运行 Visual Studio 的同一实例中。例如,Visual Studio 2010 终极有 Microsoft Visual Basic 速成版 Service Pack 1 安装在...
    • Visual Studio 2010 SP1
      如果您在同一台计算机上安装多个版本的 Visual Studio 2010,程序二进制文件的组合可能会运行 Visual Studio 的同一实例中。例如,Visual Studio 2010 终极有 Microsoft Visual Basic 速成版 Service Pack 1 安装在...