Visual Studio代码 - “错误:生成jdb ENOENT”试图调试java应用程序

时间:2016-09-12 22:16:24

标签: java debugging visual-studio-code jdb

我正在尝试在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而我正试图找到它应该配置的位置。

1 个答案:

答案 0 :(得分:1)

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