This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I use Ubuntu. I open a bash and type sudo apt-get install sun-java6-jdk sun-java6-bin sun-java6-jre
It downloads, configures etc. Then I use gedit to write a hello world java program. I save it to /home/user/Documents and use the standard javac and java commands to run the java program. I believe the procedure is similar. Make sure you are in the directory where your source file is stored before you use javac and java commands.