报错问题: 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 52.0
这个错误说明Jenkins Agent(或 Remoting)使用的 Java 版本太低。
版本对应关系:
| Class File Version | Java版本 |
|---|---|
| 52.0 | Java 8 |
| 55.0 | Java 11 |
| 61.0 | Java 17 |
因此:
- 当前运行 Agent 的 JVM =Java 8
- Jenkins Remoting 编译版本 =Java 17
- 导致无法启动
解决方法:
升级JDK版本到17 LTS以上版本