I\'ve been trying to install the jdk on my ubuntu after downloading it.
first I\'ve used: sudo apt-get update
then: sudo apt-get install jdk*
It's same as vikasdumca's steps, but thought to share the link.
run the following command
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
then
sudo apt-get install oracle-java8-installer
this would install oracle java 8 on ubuntu properly.
find it from this post
you can find more info on "Managing Java" or "Setting the "JAVA_HOME" environment variable" from the post.