你如何清除 Eclipse 中的验证错误?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3420536/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:32:54  来源:igfitidea点击:

How do you clear the validation errors in Eclipse?

eclipse

提问by James Smith

I accidentally clicked on "Validate" for all of my projects (instead of going to Team > synchronize...) and I have several validation errors and tons of warnings.

我不小心点击了我所有项目的“验证”(而不是去团队 > 同步...),我有几个验证错误和大量警告。

I can't figure out how to clear these so it goes back to just having the standard errors.

我不知道如何清除这些,所以它回到只有标准错误。

(One way is to go to "Configure Contents" of the "Problems" view and deselect the validation errors, but I know they're still there, just hidden... it bugs me that they're not actually removed)

(一种方法是转到“问题”视图的“配置内容”并取消选择验证错误,但我知道它们仍然存在,只是隐藏了......让我感到烦恼的是它们实际上并没有被删除)

I've tried restarting eclipse, tried cleaning all projects but that doesn't clear these validation errors.

我试过重新启动 eclipse,尝试清理所有项目,但这并没有清除这些验证错误。

回答by Tom Crockett

You should be able to select all the offending markers in the Problems View, right-click and choose Deletefrom the context menu. Clean-building causes all builders to remove only the markers that they produced, but these markers weren't produced by a builder (you created them through an explicit invocation of the "validate" command.)

您应该能够在问题视图中选择所有有问题的标记,右键单击并Delete从上下文菜单中进行选择。Clean-building 会导致所有构建器仅删除它们生成的标记,但这些标记不是由构建器生成的(您通过显式调用“validate”命令创建了它们。)

回答by takteek

I'm not aware of a built-in way to clear them all. You might try deleting the markers file in

我不知道有一种内置的方法可以清除它们。您可以尝试删除中的标记文件

[workspace dir]/.metadata/.plugins/org.eclipse.core.resources/.projects/[project name]

回答by Pavel Coufal

Go to Window -> Show View -> Problems and delete error marker(s) on right mouse-click

转到窗口 -> 显示视图 -> 问题并右键单击删除错误标记

回答by Alexander Pogrebnyak

You probably want to exclude some third party libraries (such as jquery-1.x.min.js) from being validated by your project.

您可能希望从项目验证中排除某些第三方库(例如 jquery-1.x.min.js)。

In this answer I've documented how to disable it for specific sources -> How do I remove javascript validation from my eclipse project?

在这个答案中,我记录了如何为特定来源禁用它 ->如何从我的 eclipse 项目中删除 javascript 验证?

I'll just repeat the steps here:

我只是重复这里的步骤:

  1. Right click your project
  2. Select Properties -> JavaScript -> Include
  3. Path Select Sourcetab. ( It looks identical to Java Build Path Source tab )
  4. Expand JavaScript source folder
  5. Highlight Excludedpattern
  6. Click Editbutton
  7. Click Addbutton next to Exclusion patternsbox.
  8. You may either type Ant-style wildcard pattern, or click Browsebutton to mention the JavaScript source by name.
  1. 右键单击您的项目
  2. 选择属性 -> JavaScript -> 包含
  3. 路径选择Source选项卡。(它看起来与 Java Build Path Source 选项卡相同)
  4. 展开 JavaScript 源文件夹
  5. 高光Excluded图案
  6. 单击Edit按钮
  7. 单击框Add旁边的按钮Exclusion patterns
  8. 您可以键入 Ant 风格的通配符模式,或单击Browse按钮以按名称提及 JavaScript 源。

BTW, I think you should never disable validation for sources that you are in control of (i.e. coded by yourself or your team).

顺便说一句,我认为您永远不应该对您控制的来源(即由您自己或您的团队编码)禁用验证。

回答by MarcelS

In case you select and delete more than 100 problems and eclipse only deletes up to 100 problems, check the "Configuration Contents..." menu. This menu is the top-right of the problems tab. There is a small triangle drop down menu containing the configuration. In that menu, there is a "Use limits" checkbox which you should uncheck to be able to dleete all problems at once.

如果您选择并删除了 100 多个问题,而 eclipse 最多只能删除 100 个问题,请检查“配置内容...”菜单。此菜单位于问题选项卡的右上角。有一个包含配置的小三角形下拉菜单。在该菜单中,有一个“使用限制”复选框,您应该取消选中该复选框以便能够一次删除所有问题。

回答by Mangesh

I was facing same problem but i am able to remove these errors.

我遇到了同样的问题,但我能够消除这些错误。

  1. Go to project properties -> validations and click on override validation preferences.
  2. Click on disable all and Apply changes and click on okay. Let the project built.
  3. Again go to project properties and change the validation settings as of original.
  1. 转到项目属性 -> 验证并单击覆盖验证首选项。
  2. 单击全部禁用和应用更改,然后单击确定。让项目建成。
  3. 再次转到项目属性并更改原始验证设置。

回答by Ravi Parekh

In Indogo

在 Indogo

GO to

Property -> Builder - > Uncheck Validator

Property -> Builder - > Uncheck Validator

回答by Josephine Mary

To disable validators in your project or workspace, complete the following steps:

要在您的项目或工作区中禁用验证器,请完成以下步骤:

  1. Click Window--> Preferences and select Validation in the left pane. The Validation page of the Preferences window lists the validators available in your project and their settings.
  2. To disable individual validators, clear the check boxes next to each validator that you want to disable. Each validator has a check box to specify whether it is enabled for manual validation or on a build.
  3. Optional: You can also change the following check box options on this page:

    • Allow projects to override these preference settings--->Select to set individual validation settings for one or more of your projects.
    • Suspend all validators-->Select to prevent validation at the global level. If you select this check box, you can still enable validation at the project level.
  1. 单击窗口--> 首选项并在左窗格中选择验证。首选项窗口的验证页面列出了项目中可用的验证器及其设置。
  2. 要禁用单个验证器,请清除要禁用的每个验证器旁边的复选框。每个验证器都有一个复选框,用于指定是否启用手动验证或构建。
  3. 可选:您还可以更改此页面上的以下复选框选项:

    • 允许项目覆盖这些首选项设置--->选择为您的一个或多个项目设置单独的验证设置。
    • 暂停所有验证器-->选择以防止在全局级别进行验证。如果选中此复选框,您仍然可以在项目级别启用验证。

Then Click OK.

然后单击确定。

If you want to set individual validation settings for one or more of your projects, see Overriding global validation preferences

如果要为一个或多个项目设置单独的验证设置,请参阅覆盖全局验证首选项