1. 程式人生 > >eclipse報錯:Multiple annotations found at this line:

eclipse報錯:Multiple annotations found at this line:

開啟專案發現之前寫好的程式碼竟然出現了錯誤,看了下這篇文章解決了

Multiple annotations found at this line:
- String cannot be resolved to a type
- The method getContextPath() from the type HttpServletRequest refers to the missing type String

解決辦法:

首先 右擊該專案 - Build Path - Configure Build Path , 在 Libraries 選項下,會發現有個出錯的jre Libraries,將其Remove掉。

然後 右擊該專案 - Build Path - Add Library, 選擇JRE System Library,選擇Workspace defaulr JRE(jdk1.6)(此前JDK已成功安裝並配置好), 然後 Finish 。