MyEclipse报错:Multiple annotations found at this line: - String cannot be resolved

论坛 期权论坛 脚本     
已经匿名di用户   2022-5-29 19:15   2029   0

使用Myeclipse新建web项目后,index.jsp文件中报错

报错信息如下:

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

这是项目没有配置java library 导致的。

解决办法:

1. 选择项目----右键build path----configure build path

2. 在Java Build Path----Libraries tab中,点击Add Library按钮

3. 选择JRE System Library,点击Next

4. 由于安装完Myeclipse之后就已经配置过jdk,直接点击Finish按钮

5. 可以看到JRE library添加成功,应用并关闭窗口,会看到报错信息消失。

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:81
帖子:4969
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP