# java.lang.UnsupportedClassVersionError: hudson/remoting/Launcher has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

- **ID:** `cicd/jenkins-agent-java-version-mismatch`
- **Domain:** cicd
- **Category:** runtime_error
- **Error Code:** `JENKINS_JAVA_VERSION`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

Jenkins agent is running an older Java version (e.g., Java 11) than the Jenkins controller (e.g., Java 17), causing remoting jar incompatibility.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Jenkins 2.440 | active | — | — |
| Jenkins 2.450 | active | — | — |
| Java 11 | active | — | — |
| Java 17 | active | — | — |
| Java 21 | active | — | — |

## Workarounds

1. **On the Jenkins agent, install Java 17 or later matching the controller's version. Update JAVA_HOME and restart the agent service. For Linux: sudo apt install openjdk-17-jre && sudo systemctl restart jenkins-agent** (90% success)
   ```
   On the Jenkins agent, install Java 17 or later matching the controller's version. Update JAVA_HOME and restart the agent service. For Linux: sudo apt install openjdk-17-jre && sudo systemctl restart jenkins-agent
   ```
2. **Use the 'WebSocket' agent connection mode instead of TCP: In Jenkins controller, configure the agent to use WebSocket (under Advanced > WebSocket). This bypasses some class version checks.** (75% success)
   ```
   Use the 'WebSocket' agent connection mode instead of TCP: In Jenkins controller, configure the agent to use WebSocket (under Advanced > WebSocket). This bypasses some class version checks.
   ```

## Dead Ends

- **** — Updating the agent.jar file manually without updating the Java runtime still fails because the agent JVM is too old. (80% fail)
- **** — Setting JAVA_HOME on the agent to a Java 8 installation makes the error worse as the version gap increases. (90% fail)
- **** — Restarting the Jenkins controller does not affect agent Java versions; the agent must be upgraded independently. (70% fail)
