報錯:Multiple annotations found at this line: - String cannot be resolved to a type解決方法

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 default JRE(此前JDK已成功安裝並配置好), 然後 Finish 。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章