The Java compiler detects unreachable code, unused variables, parameters, imports and unused private types, methods and fields. The setting is on the Java > Compiler preference page.