更多>>Java程序設計 Blog
來源:一度好 時間:2019-07-26 閱讀:11479
在使用 Spring Tool Suite 的時候,出現The compiler compliance specified is 1.8 but a JRE 12 is used警告的解決方法
一、具體問題
1、在工程名的圖標上有個黃色嘆的圖標,如圖所示:
2、點開Problems,發現具體的警告信息內容如下:
The compiler compliance specified is 1.8 but a JRE 12 is used
意思是說你指定的編譯器版本號為1.8,而你實際安裝使用的JRE 12
如圖所示:
3、自己安裝使用的JDK版本號為JDK12
二、解決方案
1、右鍵點擊工程項目圖標 demo,選擇彈出菜單的最底部的“Perproties”
2、在彈出的窗口中點擊“Java Compiler”,在右側的窗口中 JDK Compliance 一項中,不勾選
然后,Compiler compliance level 這一項由灰色變成高亮顯示,在后面的列表選擇框中,將默認顯示的1.8,修改為12
如圖所示:
3、點擊“Apply”,點擊“Apply and Close”
4、相應的同步修改 pom.xml 文件中的java版本號
修改前:
<properties>
<java.version>1.8</java.version>
</properties>
修改后:
<properties>
<java.version>12</java.version>
</properties>
5、警告信息消失,問題解決
評論列表 |
![]() Thank you For your hard work o 來自黎巴嫩
Thank you For your hard work over the years! For this, we give you the opportunity. https://google.com#1234567890 For more information, see the instructions. skfhjvkjsdjsrbhvbsrfhkis
2023-09-06 03:45:53 ![]() Push it to the limit cool Wolf 來自羅馬尼亞
Push it to the limit cool Wolf you are the best and you can do everything https://www.samsung.com smkmkplobydlmcrjmzgvx
2023-08-15 02:28:01 |
發表評論