If you want to setup a more restricted development environment to create Java code with higher code quality, have a look at the Eclipse preferences settings under Java -> Compiler -> Errors/Warnings.
Here you can define how the Java compiler should react to certain common programming problems, e.g. you can define that “Assignement has no effect (e.g. x=x)” causes an error in Eclipse.
I highly recommend the usage of restrictive settings here to improve your code quality. For example I consider the following settings as important:
This should only be your first step, additional checks are provided by Findbugs and Checkstyles Using FindBugs and Checkstyle in Eclipse – Tutorial