Can anyone tell me how can we perform code analyze using PMD or Checkstyle during develop time....
I want to know it so as instead of checking at the last for bugs,i can correct them as soon as i find it.

I searched in google and there i found a blog which says we can use ANT script,but i am not sure whether it will work or not....
Please can anyone tell me...
Thanks in advance...

Checkstyle, PMD, Finbug, Surfire and many other useful stuff for Java code checking can be added through your IDE, building tools (Ant, Maven {plugins}, Gradle) or as plugin on number of CI(Continuous integration) solutions such as Jenkins, TeamCity, Sonar

So the question is, what is your next step? :P