Search code examples
eclipsepmdsuppress-warningssystemexit

Unsupported @SuppressWarnings("PMD.DoNotCallSystemExit")


I need to use System.exit(0) in an application. Eclipse has the PMD plugin installed and complains about this line of code. Adding @SuppressWarnings ("PMD.DoNotCallSystemExit") remove that warning but now I get a warning that this SuppressWarnings is unsupported, despite the fact that it works.

Is there a way to resolve this?


Solution

  • To get Eclipse to not flag the @SuppressWarnings("PMD") annotation, look under the menu headings Java -> Compiler -> Errors/Warnings -> Annotations -> Unhandled Token in '@SuppressWarnings' and set it to ignore.

    Right on the PMD page.