当前位置:
首页 >
行业知识 >
has been compiled by a more recent version of the Java Runtime (class file version 55.0)解决方法
行业知识
has been compiled by a more recent version of the Java Runtime (class file version 55.0)解决方法
2026-12-04 16:03:17
来源:互联网转载
Java项目编写完成后生成jar包,在cmd窗口运行时出现如下异常:Exception in thread "main" java.lang.UnsupportedClassVersionError: com/itbaizhan/travel/TravelApplication 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
造成以上异常的原因是:当前计算机环境的JDK 与 编写项目时打包的JDK版本不一致。而且一般旧版本的JDK环境无法运行新版本JDK生成的jar包,需要查看项目的JDK版本,然后在计算机环境变量中重新配置JAVA_HOME。