【问题标题】:Visual Studio Code - "Error:spawn jdb ENOENT" trying to debug java app [duplicate]Visual Studio Code - “错误:spawn jdb ENOENT”试图调试java应用程序[重复]
【发布时间】:2017-01-20 10:32:12
【问题描述】:

我正在尝试在 Visual Studio Code 中调试 java 应用程序并收到以下错误: "Error:spawn jdb ENOENT".

Vs Code 建议更新我的 launch.json,其中包含以下内容:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Java",
            "type": "java",
            "request": "launch",
            "stopOnEntry": true,
            "cwd": "${fileDirname}",
            "startupClass": "${fileBasename}",
            "options": [
                "-classpath",
                "\"${fileDirname};.\""
            ]
        },
        {
            "name": "Java Console App",
            "type": "java",
            "request": "launch",
            "stopOnEntry": true,
            "cwd": "${fileDirname}",
            "startupClass": "${fileBasename}",
            "options": [
                "-classpath",
                "\"${fileDirname};.\""
            ],
            "externalConsole": true
        }
    ]
}

我正在使用 maven 构建并安装了以下 VSCode 插件https://github.com/DonJayamanne/javaVSCode

Maven pow.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
    http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.ams-sample</groupId>
  <artifactId>AMSSample</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>NumberGenerator</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>azure-storage</artifactId>
  <version>4.0.0</version>
   <scope>system</scope>
    <systemPath>${basedir}/lib/azure-storage-4.0.0.jar</systemPath>
</dependency>
 <dependency>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>azure-core</artifactId>
  <version>0.9.4</version>
   <scope>system</scope>
   <systemPath>${basedir}/lib/azure-core-0.9.0.jar</systemPath>
</dependency>
     <dependency>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>azure-media</artifactId>
  <version>0.9.4</version>
  <scope>system</scope>
  <systemPath>${basedir}/lib/azure-media-0.9.0.jar</systemPath>
</dependency>
  </dependencies>
</project>

我目前的假设是 VS Code 无法找到 jdb.exe,我正在尝试找到应该配置它的位置。

【问题讨论】:

    标签: java debugging visual-studio-code jdb


    【解决方案1】:

    问题与缺少指向C:\Program Files\Java\jdk1.8.0_102\bin 的%PATH% 有关。一旦系统变量 %PATH% 被修改为包含 C:\Program Files\Java\jdk1.8.0_102\bin VS Code 启动的 java 调试器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-02
      • 2016-10-12
      • 1970-01-01
      • 1970-01-01
      • 2018-08-20
      • 2019-03-09
      • 2022-06-15
      • 2021-12-23
      相关资源
      最近更新 更多