You could either download the
.tar.gz package from oracle website.
The default download path (not from command terminal) is
Create a folder under
If your access is denied, that means you need to use root to realize that.
You can either:
or change directly the right your username group as root:
In the file poped up, find the line with your username, for instance, your username is “blabla” then find “ blabla:x:1000:1000:crystal:/home/linuxidc:/bin/bash”.
Modify the two 1000 to two 0: “blabla:x:0:0:crystal:/home/linuxidc:/bin/bash”. This method is not recommanded since it’s a bit dangerous.
You will find that the start symbol of command line is “#” instead of “$” and you can create the folder again.
Then type the following code (suppose we don’t modify the user right and the downloaded file is saved under /Home/):
If you feel sufferred using vi, try to install vim then use it.
i to switch to insert mode and enter the info below:
Esc to quit insert mode. Enter
:w! to save the changes and enter
:q to quit vi.
Source the file and activate the changes.
The default version of jdk in some OS is OpenJDK. So you need to specify the default to be jdk from Oracle.
In Ubuntu 14.04 OpenJDK is not preloaded, so I don’t need to do this step.
Check if the installation is successful.
The info returned proves that we’ve successfully installed Oracle jdk 8u60.