报错内容:
Exception in thread "main" java.lang.UnsupportedClassVersionError: test/hello has been compiled by a more recent version of the Java Runtime (class file version 62.0), this version
of the Java Runtime only recognizes class file versions up to 52.0
翻译了一下发现自己可以理解这个错误!
Java .lang. unsupportedclassversionerror: test/hello已由Java运行时的最新版本(类文件版本61.0)编译,该版本的Java运行时只识别52.0以下的类文件版
意思就是说我们用eclipse打包的时候用的JDK的版本和Linux运行的JDK版本不一致导致兼容性问题!
找到了问题所在我们就可以进行排除!
点击window->preferences->java->compiler
jdk版本应在1.8一下适配Linux上面的jdk版本
完成应用
再次打jar包上传到Linux
重写执行
完成打包继续运行jar包