Have you get stuck anytime to install the Java in Ubuntu ?
This post helps to install the java in ubuntu in easy steps. I assume we are installing Java in 64 bit machine. Here it goes
Step 1: Download the Java from this link
Step 2: Extract the files using the following commands
chmod +x jdk-6u38-linux-x64.bin./jdk-6u38-linux-x64.bin
Step 3: The following command gives the ownership to the folder and sub folders and moves to the /usr/lib folder.
sudo chown root. -R jdk1.6.0_38/
sudo mv jdk1.6.0_38/ /usr/lib/jvm/
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_38/bin/javac" 1
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_38/bin/java" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_38/bin/javaws" 1
Here is the short introduction about the alternatives system.
The Debian alternatives system creates a way for several programs that fulfill the same or similar functions to be listed as alternative implementations that are installed simultaneously but with one particular implementation designated as the default. For example many systems have several text editors installed at the same time. The vi program is a classic example of an editor that has many implementations such as nvi, elvis, vim, etc. but which one should be designated as the default?
Debian’s alternatives system aims to solve the problem of selecting a default preferred version. Management is done through the update-alternatives program that creates, removes, maintains and displays information about the symbolic links constituting the Debian alternatives system.
update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the Debian alternatives system.
Step 6: The following commands to confirm from the Alternatives are properly set
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
and also one more command to check as well
ls -la /etc/alternatives/java*
Java installation is done in Ubuntu. Please share your comments if you like it.
There is a alternative way to do that. Here it is
Step 1: Add the following command in the Terminal
sudo add-apt-repository ppa:webupd8team/java
Step 2: Finally, run the commands below to update your system and install Oracle Java 6 (Sun Java)
sudo apt-get update && sudo apt-get install oracle-java6-installer
You can more information from this website