Description:Because many systems do not support the use of OPENJDK, it is necessary to install Oracle JDK under Ubuntu. While the installation of Oracle JDK does not seem to provide the apt way, so the way to install Oracle JDK is relatively troublesome, I often install, in order to facilitate others at the same time to check, write it down.
First step: differentiate between 32-bit or 64-bit operating systemsFirst determine whether your Ubuntu Linux is 32-bit or 64-bit, a lot of methods, here is a description. $uname-A
Step Two: Uninstall OpenJDKRun the following command to see if OPENJDK is installed, and if it is already installed, the Java information will be displayed. $java-version (as shown below, the current system is not installed in any Jdk,ubuntu System package already has OPENJDK, can be installed directly openjdk) under Ubuntu system, you can also run the following command: sudo apt-cache Search Java If OPENJDK is installed, it can be uninstalled as follows: $sudo Apt-get purge openjdk-\* step three: Install Oracle JDK
Use the following command to install, just some time, it will download a lot of files, and you want to make sure that your network environment is good:
1 sudo add-apt-repository ppa:webupd8team/java2 sudo apt-get update 3 sudo Install oracle-java8-installer4 sudoinstall Oracle-java8-set-default
If you want to install Java 7 (i.e Java 1.7), use JAVA7 instead of java8 in the command above.
The process is as follows:
Update may fail due to network causes, multiple update times succeeded
Installing Oracle JDK on Ubuntu Linux