最近遇到這個問題,在網上查到的解決方案基本都是下面幾個:
1、右擊項目,properties,project facets,改動java的version爲1.7。
2、window,properties,java,compiler,改動compiler comliance level 爲1.7.
3、window,properties,java,installed jres,新增一個1.7的,並選中。
不過,上面都沒有能解決我的問題,後來在tomcat的配置中,發現jre版本不對,路徑如下:
window,properties,server,runtime environments,選中Apache tomcat7,點擊右側edit,改動jre爲1.7版本的。