1, through the PPA this installation mode features: 1, installed Java with JDK, JRE and browser plug-in 2, automatically identify 64bit or 32BIT3, automatically upgrade to the latest version 4, support Ubuntu 13.10, 13.04, 12.10, 12.04 and 10.04 or Linux Mint1.1 Execute the installation command in the terminal:
sudo add-Apt-Repository PPA:Webupd8team/Javasudo apt-GetUpdatesudo apt-GetInstall Oracle-Java7-Installer1.2 Verify that the installation is successful:
Java-version1.3 Removing Oracle Java 7
sudo apt-GetRemove Oracle-Java7-Installer2, manual Installation 2.1 Download the latest Java installation file tar.gz format, in this case jdk-7u45-linux-x64.tar.gz, download to/opt. Http://www.oracle.com/technetwork/java/javase/downloads/index.html 2.2 Decompression
Tar zxvf jdk-7u45-Linux-x64.Tar.GZ2.3 Setting environment variable commands
sudo gedit~/.BASHRCAdd the following line at the end of the file:
ExportJava_home=/opt/JDK1.7.0_45ExportJre_home=$JAVA _home/JREExportCLASSPATH=.:$JAVA _home/Lib:$JRE _home/Lib:$CLASSPATHExportPATH=$JAVA _home/bin:$JRE _home/bin:$PATHThen save, exit, and use the source command to make it effective
source ~/. Profile2.4 Change the default JDK version to see the Java version and priority of the system installed
sudo update-Alternatives--dispaly Javathe system is installed by default only OPEN-JDK, and the priority is 1051, set a higher priority to Oracle's JDK, such as 1200, in the terminal window to execute the following command:
sudo update-Alternatives--Install/usr/bin/Java Java/opt/JDK1.7.0_45/bin/Java - sudo update-Alternatives--Install/usr/bin/Javac Javac/opt/JDK1.7.0_45/bin/Javac - sudo update-Alternatives--Install/usr/bin/Jar Jar/opt/JDK1.7.0_45/bin/Jar - sudo update-Alternatives--Install/usr/bin/Javah Javah/opt/JDK1.7.0_45/bin/Javah - sudo update-Alternatives--Install/usr/bin/JAVAP JAVAP/opt/JDK1.7.0_45/bin/JAVAP - View all Java versions installed in the system
sudo update - Alternatives -- config Java
If the Oracle JDK is not the default configuration (the row that identifies *), change to Oracle JDK as the default JDK by selecting the line number. 2.5 Testing
java -version