如何在特定文件的基础上禁用 Eclipse 中的编译器警告?

How can I disable compiler warnings in Eclipse on a file specific basis?(如何在特定文件的基础上禁用 Eclipse 中的编译器警告?)

本文介绍了如何在特定文件的基础上禁用 Eclipse 中的编译器警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Eclipse 项目中有一些生成的 .java 文件,我需要将它们用于 SQLJ,但我无法移至单独的项目(由于管理开销).这些文件也会定期重新生成,因此很遗憾无法编辑它们.

In my Eclipse project are a handful of generated .java files that I need to use for SQLJ and I can't move to a separate project (due to Administrative Overhead). These files are also regularly regenerated so editing them is unfortunately out.

不幸的是,这些文件生成了数百个 java 编译器警告,这些警告淹没了我在实际可以编辑的文件上收到的有用警告.

Unfortunately these files generate a few hundred java compiler warnings which drown out the useful warnings I get on files that I actually can edit.

在 Eclipse 中有什么方法可以说 Ignore all the warnings of a file-by-file based?或者我可以屏蔽一个特定的子目录吗?

Is there any way in Eclipse to say Ignore all the warnings of a file-by-file basis? Or can I block out a specific sub-directory?

推荐答案

eclipse中的问题"视图可以过滤;我总是将其设置为仅在选定元素及其子元素上".当然,这更像是一种解决方法,但它减少了将文件放在同一个项目中的影响.(请注意,即使您必须将它们放在同一个项目中,也可以将它们保存在单独的源文件夹中.

The "problems" view in eclipse can be filtered; I always have it set to "on selected element and its children only". Granted, this is more of a work-around, but it lessens the impact of having the files in the same project. (Note that even if you must have them in the same project, you can keep them in a separate source folder).

要配置过滤器,请在问题视图的右上角找到带有工具提示查看菜单"的向下箭头图标.点击它,然后点击配置内容".

To configure the filters, find the icon with a downward arrow with tooltip "View Menu" on the top right of the problems view. Click it, and then click "configure contents".

这篇关于如何在特定文件的基础上禁用 Eclipse 中的编译器警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何在特定文件的基础上禁用 Eclipse 中的编译器警告?

基础教程推荐