# 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.

- **ID:** `java/gradle-task-execution-failure`
- **Domain:** java
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The Java home path points to a JRE instead of a JDK, or the JDK installation is incomplete.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 8+ | active | — | — |

## Workarounds

1. **Set JAVA_HOME to a proper JDK installation** (95% success)
   ```
   export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 (ensure it points to JDK, not JRE)
   ```
2. **Install a full JDK if missing** (90% success)
   ```
   sudo apt-get install openjdk-11-jdk
   ```

## Dead Ends

- **Setting JAVA_HOME to a JRE directory** — JRE does not contain tools.jar, which is needed for annotation processing or certain plugins. (95% fail)
- **Downloading tools.jar separately and placing it in the JRE lib folder** — This is not a supported configuration and may cause compatibility issues. (90% fail)
