Jenkins 添加节点Node报错JNI error has occurred UnsupportedClassVersionError

节点日志 报错信息如下
Error: A JNI error has occurred, please check your installation and try again
Exception in thread “main” java.lang.UnsupportedClassVersionError: hudson/remoting/Launcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

从文字上看第一个错误类型是属于不支持的字节码版本,那就想到当前jenkins默认是用的java 11版本,而目标节点机器上用的java 8,字节码版本不兼容,我试过把这个jenkins的jdk改为11,不行,启动报错,那就只好改目标机器上的java版本了,于是在目标节点机器下载了java 11并把版本选择设置默认为11版本,然后重新laugh Node后节点上线成功。

下载java 11

sudo apt install openjdk-11-jdk --fix-missing

更换java默认版本

 update-alternatives --config java

Jenkins 添加节点Node报错JNI error has occurred UnsupportedClassVersionError_第1张图片

你可能感兴趣的:(Java,jenkins,运维)