Unresolved compilation problem: The method preHandle(HttpServletRequest, HttpServletResponse

本文解决MyEclipse中因IDE编译器合规级别与已安装JRE版本不匹配导致的大量编译错误问题,提供调整IDE设置以确保两者版本一致的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

java.lang.Error: Unresolved compilation problems: The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly ref erenced from required .class files The type javax.servlet.ServletResponse cannot be resolved. It is indirectly referenced from required .class files The type javax.servlet.ServletRequest cannot be resolved. It is indirectly referenced fr om required .class files The import javax.servlet.http.Cookie cannot be resolved The import javax.servlet.http.HttpServletRequest cannot be resolved The import javax.servlet.http.HttpServletResponse cannot be resolved HttpServletRequest cannot be resolved to a type HttpServletResponse cannot be resolved to a type The type javax.servlet.ServletException cannot be resolved. It is indirectly referenced from required .class files The method buildWrapper() from the type ParameterWrapper refers to the missing t ype ServletException Cookie cannot be resolved to a type Cookie cannot be resolved to a type HttpServletRequest cannot be resolved to a type HttpServletRequest cannot be resolved to a type HttpServletResponse cannot be resolved to a type

 

问题:项目启动时很多报错(其实不用启动,随便点开一个也能发现,@Override的都在报错)!MyEclipse 报错问题。

原因:MyEclipse IDE 使用默认版本,使得 IDE 的Comp iler Compliance level 与 Installed JREs 版本不对应而导致错误。 解决方案:将 IDE 的Compiler Compliance level 与自己安装的java 版本修改为一致。(例 如:Compiler Compliance level 使用1.8时,Installed JREs版本则使用jdk1.8.0 )

路径:window-->preference-->java-->compiler

路径:具体的项目,右键-->properties-->java compiler

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值