JAVA is now the most widely used programming language for creating applications for web,gadgets,business…So you may want to install JRE(Java Runtime Environment) on your ubuntu 10.04 LTS for compiling and running JAVA based application.
Installing JDK through Command Line in Ubuntu 10.04
Use the following command to install JDK(Java Developement Kit) 6 on your Ubuntu 10.04 LTS
sudo apt-get install openjdk-6-jdk
It will automatically install other dependencies.
Install JAVA(JDK-JRE) from SPM(Synaptic Package Manager) in Ubuntu 10.04
First,search for JDK/java and select the package openjdk-6-jdk by marking for installation.It will ask you to mark some extra dependent softwares for installation,just click ok.Then click on Apply to start the download and installation process.Wait for few minutes until the downloading process will complete and installation will begin.JDK will be installed within few moments.In middle of the installation it will ask you to accept license terms for JRE,check the box to accept the license terms.You are now ready to use Java Development Kit(JDK) for creating java applications.
More Tutorial on How to compile and Run Java programs on Ubuntu 10.04