Search code examples
javaeclipsewarningsjdk1.4

Suppressing warnings for JDK1.4 project


Is it possible to suppress warnings in Eclipse for JDK1.4 project?

EDIT: Longer version. There is a project which requires JDK1.4 (no annotations). Only way of suppressing warnings I know is using annotation @SuppressWarnings - no can do in JDK1.4. Is there any way to remove some warning notifications in some specific method/class (not whole project) ?


Solution

  • If you mean that you are writing Java 1.4 code, and you are getting warnings because you aren't using generics, set your Java Compiler settings to 1.4. You can do this on a per-project basis, or for the whole workspace.

    Window->Preferences->Java->Compiler->Compiler Compliance Level = 1.4

    To disable specific warnings, such as those regarding unnecessary casts, etc., you can tailor them under the Compiler->Errors/Warnings panel. Most of these warnings, however, are not version specific, and can be quite helpful if heeded.

    Workspace settings can be overridden for a project, but I don't know of a way that gives you annotation-like control over a specific class or method.