JDK installation on Ubuntu
There may have many ways to install Java on Ubuntu. However, in this example I’ll show the manual way which is download the JDK from the official website.
There are few steps here:
Extract it and move to /opt
directory.
1 | $ tar -zxvf jdk_<version>.tar.gz |
Add Java to Environment Variable.
1 | vi ~/.bash_profile |
Activate the bash profile for immediate effect.
1 | source ~/.bash_profile |
Re-open terminal (i.e. CTRL + ALT + T
for shortcut)
1 | $ java -showversion |
It should work. Have fun :)