This section will show you how to install Oracle JDK in Linux instead of open JDK
1. Download the JDK to Oracle website: http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Unzip the JDK TAR-XVF jdk-8-linux-i586.tar.gz (32-bit) tar-xvf jdk-8-linux-x64.tar.gz (64-bit) or simply use the Unzip tool to freely
3. Move the extracted files to/usr/lib
sudo mkdir-p/USR/LIB/JVM ---Create a new JVM folder
sudo mv ./jdk1.8.0/usr/lib/jvm/---To move the JDK folder to/usr/lib
4. Enter the command on the command line as follows
Atives--install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0/bin/java" 1
sudo update-alternatives--install "/usr/bin/javac" "Javac" "/usr/lib/jvm/jdk1.8.0/bin/javac" 1
sudo update-alternatives--install "/usr/bin/javaws" "Javaws" "/usr/lib/jvm/jdk1.8.0/bin/javaws" 1
The following 1 represents the priority, and subsequent installations replace the currently installed version as the default version
5. Give permission
sudo chmod a+x/usr/bin/javasudo chmod a+x/usr/bin/javacsudo chmod a+x/usr/bin/javawssudo chown-r root:root/usr/lib/jv m/jdk1.8.0
6. List all JDK versions of the current system installation, select a run, and if the JDK is installed for the first time, the current JDK will be run
sudo update-alternatives--config javasudo update-alternatives--config javacsudo update-alternatives--config javaws
Reference URL: Http://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-jdk-6-7-8-or-jre
1.linux System Installation ORACLEJDK