【报错笔记】项目中使用ArrayList<>报错:‘<>’operator is not allowed for source level below 1.7
生活随笔
收集整理的這篇文章主要介紹了
【报错笔记】项目中使用ArrayList<>报错:‘<>’operator is not allowed for source level below 1.7
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
項目中使用ArrayList<>報錯:‘<>’operator is not allowed for source level below 1.7
解決方案:右鍵項目–屬性–Java Compiler–勾選Enable project specific settings
Compiler compliance level–選擇1.7
勾選Use default compilance settings
但是在此處改變java版本后,一旦Update項目就會自動回到1.5版本
解決方案:找到Maven安裝路徑中的settings.xml文件,然后更改默認jdk版本
然后Update項目就可以了。
在程序中是此處出了錯誤,所以將代碼修改了就好了
總結
以上是生活随笔為你收集整理的【报错笔记】项目中使用ArrayList<>报错:‘<>’operator is not allowed for source level below 1.7的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【报错笔记】项目使用了JSONArray
- 下一篇: 【报错笔记】使用MultipartFil