# java.lang.ClassDefNotFoundException

- **ID:** `java/class-def-not-found-error`
- **Domain:** java
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The JVM cannot find the definition of a class that was referenced at compile time, typically due to a missing or mismatched class file in the classpath or an incomplete build artifact.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Java 8 | active | — | — |
| Java 11 | active | — | — |
| Java 17 | active | — | — |
| Java 21 | active | — | — |

## Workarounds

1. **Run 'mvn clean install' or 'gradle clean build' to force a full rebuild and ensure all class files are generated correctly.** (85% success)
   ```
   Run 'mvn clean install' or 'gradle clean build' to force a full rebuild and ensure all class files are generated correctly.
   ```
2. **Check the classpath using 'java -verbose:class YourMainClass' to see which class files are loaded and identify the missing one.** (75% success)
   ```
   Check the classpath using 'java -verbose:class YourMainClass' to see which class files are loaded and identify the missing one.
   ```

## Dead Ends

- **** — This may include duplicate or conflicting versions of the same class, leading to other linkage errors, and does not address missing dependencies from transitive dependencies. (40% fail)
- **** — Stale class files from previous builds can mask the real issue; a clean build is necessary to ensure all classes are regenerated. (60% fail)
