Multiple markers at this line @Override的解决方法
2016-09-30 16:53
756 查看
使用Eclipse 进行项目开发,在实现类中的方法前面如果添加@Override就提示“Multiple markers at this line”的错误,问题描述如下
Multiple markers at this line
- The method getStudentByID(String) of type StudentBeanImpl must override a superclass method
- implements mgr.jc.student.service.IStudentBean.getStudentByID
![](https://img-blog.csdn.net/20140606212839750?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWF6aGFvanVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
出现上述问题的原因:JDK1.5不支持这种写法。实现接口方法需要重写抽象方法。
解决上述问题的方法如下:
方法1.选择Eclipse的Window→Preferences→Java→Compiler,把Compiler
compliance level从1.5改成1.6。
![](https://img-blog.csdn.net/20140608164118406?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWF6aGFvanVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
方法2.右击project选择最后一个properties选择左侧的java compiler,勾选里面的框框,把java编辑器版本都改成1.6。
![](https://img-blog.csdn.net/20140608164201328?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWF6aGFvanVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
方法3.右击project下的 JRE System Library[JavaSE-1.5]→Properties,Execution environment 选择“JavaSE-1.6(JDK1.6.0_10)”,点击确定即可。
![](https://img-blog.csdn.net/20140608164235296?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWF6aGFvanVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
上述3种方法都能解决题目中提到的问题,可以根据自己的习惯选择相应的解决方法。
Multiple markers at this line
- The method getStudentByID(String) of type StudentBeanImpl must override a superclass method
- implements mgr.jc.student.service.IStudentBean.getStudentByID
出现上述问题的原因:JDK1.5不支持这种写法。实现接口方法需要重写抽象方法。
解决上述问题的方法如下:
方法1.选择Eclipse的Window→Preferences→Java→Compiler,把Compiler
compliance level从1.5改成1.6。
方法2.右击project选择最后一个properties选择左侧的java compiler,勾选里面的框框,把java编辑器版本都改成1.6。
方法3.右击project下的 JRE System Library[JavaSE-1.5]→Properties,Execution environment 选择“JavaSE-1.6(JDK1.6.0_10)”,点击确定即可。
上述3种方法都能解决题目中提到的问题,可以根据自己的习惯选择相应的解决方法。
相关文章推荐
- Multiple markers at this line @Override的解决方法
- Multiple markers at this line @Override的解决方法
- 使用@Override 报错Multiple markers at this line 的解决方法
- Multiple markers at this line @Override的解决方法
- Multiple markers at this line @Override的解决方法
- Multiple markers at this line @Override的解决方法
- Multiple markers at this line @Override的解决方法
- Multiple markers at this line @Override的解决方法
- Multiple markers at this line @Override的解决方法 .
- Multiple markers at this line @Override的解决方法
- Multiple markers at this line @Override的解决方法
- Multiple markers at this line - Missing semicolon时的解决方法
- Eclipse/MyEclipse的web项目中的js文件报Multiple markers at this line - Missing semicolon时的解决方法
- MyEclipse的web项目中的js文件报Multiple markers at this line - Missing semicolon时的解决方法
- 【转】 Android下Multiple markers at this line的解决方法
- Android下Multiple markers at this line的解决方法
- Android下Multiple markers at this line的解决方法
- MyEclipse的web项目中的js文件报Multiple markers at this line - Missing semicolon时的解决方法
- MyEclipse中出现Multiple annotations found at this line: - Syntax error, insert "}" to complete 错误解决方法
- Multiple markers at this line @override