I started to find openjdk Java in the Ubuntu Software Center. When I used the uninstall option, the system prompts that the network link failed ?!! To uninstall a software package, you need to download a wool package and delete the directory/usr/lib/JVM.
Then execute:
1.download jdk-7u15-linux-i586-demos.tar.gz on sun's official website,
2. Create the directory/usr/lib/JVM: sudo mkdir/usr/lib/JVM.
3. Unzip the installation package. Tar-zxvf jdk-7u15-linux-i586-demos.tar.gz and copy it to the target directory: CP-A jdk1.7.0 _ 15
/Usr/lib/JVM/. You cannot directly decompress the package to the target folder because the-C parameter is missing. The correct command is: tar-zxvf jdk-7u15-linux-i586-demos.tar.gz
-C/usr/lib/JVM ]. You have to decompress the package before copying it. Because the File Permission cannot be changed, the-a parameter must be used for the CP command.
Then configure the Java environment variable:
Set the environment variable: Vim ~ /. Bashrc
Export java_home =/usr/lib/JVM/jdk1.7.0 _ 15
Export jre_home =$ {java_home}/JRE export classpath =. :. {java_home}/lib :$ {jre_home}/lib export path =$ {java_home}/bin: $ path
Close the terminal and open it again
Sudo Update-alternatives -- install/usr/bin/Java/usr/lib/JVM/jdk1.7.0 _ 15/bin/Java 300 sudo Update-alternatives -- install/usr/bin/javac javac/usr/lib/JVM/jdk1.7.0 _ 15/bin/javac 300
========================================================== ========================================================== ======= If there are other Java versions installed on the machine, select:
Input:
Update-alternatives -- config Java
Display:
Select the path priority status
------------------------------------------------------------
* 0/usr/lib/JVM/java-6-openjdk/JRE/bin/Java 1061 automatic mode
1/usr/lib/JVM/java-6-openjdk/JRE/bin/Java 1061 manual mode
2/usr/lib/JVM/Java-6-sun/JRE/bin/Java 63 manual mode
Enter the selected number: 2
Enter
4. Verify that the Java-version has been changed to Sun's JRE.