Are there Java coding standards? If so, is there a tool that implements and checks for those standards? I'm not familiar but hoping that someone has used Sonar, Checkstyle, PMD, Findbugs, Clover, and/or Cobertura that could tell me if any of those tools or other tools can do that.
Asked
Active
Viewed 1,327 times
1
-
http://stackoverflow.com/questions/3442167/existence-of-a-java-standard http://stackoverflow.com/questions/3615348/is-there-a-coding-standard-for-java – h3xStream Nov 16 '10 at 18:28
4 Answers
1
Sun's (now Oracle's) coding conventions documentation is here:
http://www.oracle.com/technetwork/java/codeconv-138413.html
I've used Checkstyle to verify that my code follows these conventions as well as conventions adopted by organizations that I've worked for.

Greg
- 33,450
- 15
- 93
- 100
-
Is there a plugin for Checkstyle with those coding conventions? – Albert T. Wong Nov 17 '10 at 00:49
-
-
I don't remember if Checkstyle's standard coding conventions are the same as Sun's/Oracle's, but they are a good starting point that you can use. – Greg Nov 25 '10 at 04:54
1
IntelliJ can enforce coding styles and standards as well. Its Inspector can also check for possible bugs as you write code.

duffymo
- 305,152
- 44
- 369
- 561
1
Yes all these tools will do what you want. You can also add custom rules if you need to. You can also get checkstyle and findbugs plugin for Eclipse.

CoolBeans
- 20,654
- 10
- 86
- 101