Question: I have tried several ways to login to a website through java. I have used watij, HTMLunit etc. but due to not so familiar with any of these, I am not able to login successfully.

Can anyone tell me in detail how to login through java

To be more specific, I want to login to the ORKUT and want the pagesource of the page that comes after login.

Answer: 
Your best chances to do such things & survive in the real world web are with Selenium-RC.

Basically, what you will do is to remote-control your browser to do anything that you can do manually (except file uploads).

Many times, I have used this pattern:

1. Login with selenium
2. Take the cookies
3. Continue with my favourite HTTP library.
Why are you trying to login via Java, why not just use cURL? Is there something specific you're trying to accomplish?