I would like to debug the whole flow of a java program line by line and I am using eclipse how can I do that?
Create a break point in the first line of your main method then using F5 (step into) to walk through it.
BTW, such questions are all over the web. To be a good programmer, use google wisely.
There are multiple steps required to debug a java program in eclipse such as:
Putting everthing here will make the answer too long. I advice you to follow this tutorial :
http://www.vogella.com/articles/EclipseDebugging/article.html