(class file version 53.0), Java Runtime versions up to 52.0錯誤的解決方法


遇到這個錯誤是在Apache Tomcat上部署應用程序的時候遇到的,具體的錯誤描述是:

java.lang.UnsupportedClassVersionError: HelloWorld has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) ...... ...... at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)

主要的內容是:

has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method)

也就是當前的jre不能對程序進行編譯,這個問題其實很簡單,

Tomcat的版本和JDK的版本不對應導致的,當前我運行的jdk是1.8而我用的Tomcat版本是Tomcat 9所以就會出現這個問題。

解決方法:要么降低Tomcat的版本號,要不用JDK9,

當然我用的是前者,畢竟JDK9剛剛出來,出錯還是有可能的

ok,解決了。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM