I will explain you what I have done till now.
- Installed java 8 and Jenkins (tried with Tomcat and also through command line (java -jar jenkinswarfile)).And Git application.
- Installed GitHub plugin
- Created a freestyle job with a public repository along with the jenkins credentials for github.It is building.
- Created a similar job for private repository and the github fetching is failing.
- I am able to clone same repo from git application but not through jenkins.