简体   繁体   English

如何清除eclipse中的错误错误?

[英]How to purge false errors in eclipse?

From time to time in eclipse with ADT, I am getting errors that stick around even after I remove the offending code; 在使用ADT进行日食时,即使删除了有问题的代码,我也会遇到错误。 in fact, they stay even if I delete the entire content of the file, as per this screen shot: 事实上,即使我删除了文件的整个内容,它们仍然存在,按照此屏幕截图:

在此输入图像描述

The error is Syntax error on token "}", delete this token 错误是Syntax error on token "}", delete this token

Suffice to say, there is no such token. 可以说,没有这样的标记。

Obviously this is a bug, but what do I do? 显然这是一个错误,但我该怎么办? My code won't compile as a result. 我的代码不会被编译。

Most of the answers given didn't help or weren't the problem ( Clean in Ran's comment worked, though...). 鉴于大多数没有帮助的答案或者是没有问题( Clean冉的评论工作,虽然...)。 The easiest fix was CTRL+1, then "Clear All Lint Markers". 最简单的修复是CTRL + 1,然后是“Clear All Lint Markers”。

Save the the file: Ctrl + S 保存文件:Ctrl + S.

In eclipse menu: Project - > Clean 在eclipse菜单中:Project - > Clean

对我来说,只需切断整条线并将其粘贴回去就可以解决问题。

You can delete the supposedly false compiler errors in the Problems view window , eg, 您可以在“ 问题”视图窗口中删除所谓的错误编译器错误,例如, 删除假定的错误编译器错误(屏幕抓取)

Confirm deletion even though javac may recreate them: 即使javac可以重新创建它们,也要确认删除:

即使javac可以重新创建它们,也要确认删除(屏幕抓取)

  1. Try cleaning your project and re-build it. 尝试清理项目并重新构建它。 It should go. 它应该去。
  2. Try restarting adt by going to DDMS>devices>click on the small downward arrow>select "reset adb" 尝试通过转到DDMS>设备重新启动adt>单击小向下箭头>选择“重置adb”
  3. Try restarting eclipse. 尝试重启eclipse。

Any of the above solutions may work for you. 任何上述解决方案都可能适合您。

You are deleting larger content. 您正在删除更大的内容。 But some-where at Ending close of bundle which is "}", by mistake you are not deleting it. 但是在某些地方 - 在捆绑的结束时“}”,错误的你不会删除它。 So simply delete that "}" . 所以只需删除“}”即可 Then clean-up your project. 然后清理你的项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM