天天看點

probably due to a new Java class file version that isn‘t supported yet

probably due to a new Java class file version that isn’t supported yet

1. 錯誤提示

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file 
[E:\Code\git\xxx.class]; nested exception is org.springframework.core.NestedIOException: 
ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet:
 file [E:\Code\git\xxx.class]; nested exception is java.lang.IllegalArgumentException
 
org.apache.catalina.core.StandardContext.listenerStart 異常将上下文初始化事件發送到類的偵聽器執行個體.[org.springframework.web.context.ContextLoaderListener]

嚴重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.listenerStop 例外情況發送上下文删除事件[org.springframework.web.context.ContextLoaderListener],以便清單執行個體
  java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext      

2. Spring版本對應JDK版本

1.檢查一下Spring版本和JDK 版本

Spring Framework 5.3.x: JDK 8-17 (expected)

Spring Framework 5.2.x: JDK 8-15 (expected)

Spring Framework 5.1.x: JDK 8-12

Spring Framework 5.0.x: JDK 8-10

Spring Framework 4.3.x: JDK 6-8

官網位址:

​​​https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Versions​​

經過檢查是JDK1.8 不相容Spring Framework 3.2.x

3. IDEA修改項目JDK版本

1.7JDK下載下傳位址: ​​https://www.oracle.com/java/technologies/javase/javase7-archive-downloads.html#jdk-7u80-oth-JPR​​
probably due to a new Java class file version that isn‘t supported yet
選擇JDK版本
probably due to a new Java class file version that isn‘t supported yet
替換Project JDK版本
probably due to a new Java class file version that isn‘t supported yet
修改Modules 文法級别
probably due to a new Java class file version that isn‘t supported yet
設定源檔案路徑, 編輯代碼時會顯示源檔案形式
probably due to a new Java class file version that isn‘t supported yet
設定輸出路徑
probably due to a new Java class file version that isn‘t supported yet
設定JDK版本
probably due to a new Java class file version that isn‘t supported yet

4.Tomcat 對應JDK版本

參考連結​​javascript:void(0)​​