{
  "id": "java/gradle-task-execution-failure",
  "signature": "Execution failed for task ':compileJava' > Could not find tools.jar. Please check that /usr/lib/jvm/java-11-openjdk-amd64 contains a valid JDK installation.",
  "signature_zh": "任务 ':compileJava' 执行失败 > 找不到 tools.jar。请检查 /usr/lib/jvm/java-11-openjdk-amd64 是否包含有效的 JDK 安装。",
  "regex": "Execution\\ failed\\ for\\ task\\ ':compileJava'\\ >\\ Could\\ not\\ find\\ tools\\.jar\\.\\ Please\\ check\\ that\\ /usr/lib/jvm/java\\-11\\-openjdk\\-amd64\\ contains\\ a\\ valid\\ JDK\\ installation\\.",
  "domain": "java",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "The Java home path points to a JRE instead of a JDK, or the JDK installation is incomplete.",
  "root_cause_type": "generic",
  "root_cause_zh": "Java 主目录路径指向 JRE 而非 JDK，或 JDK 安装不完整。",
  "versions": [
    {
      "version": "8+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Setting JAVA_HOME to a JRE directory",
      "why_fails": "JRE does not contain tools.jar, which is needed for annotation processing or certain plugins.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Downloading tools.jar separately and placing it in the JRE lib folder",
      "why_fails": "This is not a supported configuration and may cause compatibility issues.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Set JAVA_HOME to a proper JDK installation",
      "success_rate": 0.95,
      "how": "export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 (ensure it points to JDK, not JRE)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Install a full JDK if missing",
      "success_rate": 0.9,
      "how": "sudo apt-get install openjdk-11-jdk",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}