Uninstall openjdk Java under ubuntu12.10 to install Sun Java

Source: Internet
Author: User
1. Uninstall the previous JDK and mark all options that contain openjdk in the new version to completely delete it. Or execute sudo apt-Get autoremove openjdk-6-jre 2, download JDK Software

Follow these steps to install Sun JDK:

Slave.

Then configure the Java environment variable:

Set environment variables: Vim/etc/profile or Vim ~ /. Bashrc, add:

Export java_home =/share/software/jdk1.7.0 _ 17
Export Path = $ path: $ java_home/bin: $ java_home/JRE/bin
Export classpath =.: $ java_home/JRE/lib/: $ java_home/lib
Export LD_LIBRARY_PATH = $ java_home/JRE/lib/i386: $ java_home/JRE/lib/i386/Server

3. Configure JDK software: Run: sudo Update-alternatives -- install/Usr/bin/Java/share/software/jdk1.7.0 _ 17/bin/Java300 sudo Update-alternatives -- install/Usr/bin/javac/share/software/jdk1.7.0 _ 17/bin/300 modify the red part by yourself; execute: Update-alternatives -- config Java
Two candidate items can be used to replace Java (/usr/bin/Java ).
Select the path priority status
------------------------------------------------------------
* 0/usr/lib/JVM/java-7-openjdk-i386/JRE/bin/Java 1071 automatic mode
1/share/software/jdk1.7.0 _ 17/bin/Java 300 manual mode
2/usr/lib/JVM/java-7-openjdk-i386/JRE/bin/Java 1071 manual mode

Enter the selected number: 1

Enter

4. Verify the Java
-Version: changed to Sun's JRE.

Run:

Java
Version "1.7.0 _ 17"
Java (TM) se Runtime Environment (build 1.7.0 _ 17-b02)
Java hotspot (TM) server VM (build 23.7-b01, mixed mode)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.