Delete openjdk in Ubuntu and use Sun JDK instead.

Source: Internet
Author: User
Tags netbeans

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/

Or add a repository next week:

Sudo add-Apt-repository PPA: ferramrobert to/Java
Sudo apt-Get update
Sudo apt-Get install sun-java6-jdk sun-java6-plugin

Then, unzip and install
Bin etc games include jdk1.6.0 _ 31 jdk-6u31-linux-x64.bin lib man sbin share srcicetea @ Ubuntu:/usr/local $./jdk-6u31-linux-x64.bin

Subtitles will appear. Press enter until yes/no is required for the screen display. Enter y and press Enter. The JDK will be decompressed to the folder to get the JDK 1.6.0 _ 31 directory.
Now that JDK has been installed, configure it below
Run
Code:Sudo Vim/etc/environment

In environment, the following section appears:
Reference:

Java_home =/usr/local/jdk1.6.0 _ 31
Classpath =/usr/local/jdk1.6.0 _ 31/lib
Path = $ path: $ java_home/bin: $ classpath
Export path

At this time, the environment variables are successfully set (there are many ways to set the environment variables, not to list them one by one)
Ubuntu may have a default JDK, such as openjdk. If openjdk is available, we need to perform the following work to make JDK installed by default. 3. Configure JDK software:

Code:
Sudo Update-alternatives -- install/usr/bin/javac/usr/local/jdk1.6.0 _ 31/bin/javac 1071
Sudo Update-alternatives -- install/usr/bin/Java/usr/local/jdk1.6.0 _ 31/bin/Java 1071
Update-alternatives -- config Java
 
In this step, add the installed JDK to the Java menu.

Then execute
 
Update-alternatives -- config Java

In this step, select the default JDK
In this way, enter
Code:
Enter Java-version to display that the system uses Sun Java.

In this way, the installed JDK is automatically found when you install netbeans.

Supplement: Update-alternatives -- config javac is required to set javac.



Reference: Http://blog.csdn.net/oneyearlater/article/details/6324403

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/

Or add a repository next week:

Sudo add-Apt-repository PPA: ferramrobert to/Java
Sudo apt-Get update
Sudo apt-Get install sun-java6-jdk sun-java6-plugin

Then, unzip and install
Bin etc games include jdk1.6.0 _ 31 jdk-6u31-linux-x64.bin lib man sbin share srcicetea @ Ubuntu:/usr/local $./jdk-6u31-linux-x64.bin

Subtitles will appear. Press enter until yes/no is required for the screen display. Enter y and press Enter. The JDK will be decompressed to the folder to get the JDK 1.6.0 _ 31 directory.
Now that JDK has been installed, configure it below
Run
Code:Sudo Vim/etc/environment

In environment, the following section appears:
Reference:

Java_home =/usr/local/jdk1.6.0 _ 31
Classpath =/usr/local/jdk1.6.0 _ 31/lib
Path = $ path: $ java_home/bin: $ classpath
Export path

At this time, the environment variables are successfully set (there are many ways to set the environment variables, not to list them one by one)
Ubuntu may have a default JDK, such as openjdk. If openjdk is available, we need to perform the following work to make JDK installed by default. 3. Configure JDK software:

Code:
Sudo Update-alternatives -- install/usr/bin/javac/usr/local/jdk1.6.0 _ 31/bin/javac 1071
Sudo Update-alternatives -- install/usr/bin/Java/usr/local/jdk1.6.0 _ 31/bin/Java 1071
Update-alternatives -- config Java
 
In this step, add the installed JDK to the Java menu.

Then execute
 
Update-alternatives -- config Java

In this step, select the default JDK
In this way, enter
Code:
Enter Java-version to display that the system uses Sun Java.

In this way, the installed JDK is automatically found when you install netbeans.

Supplement: Update-alternatives -- config javac is required to set javac.



Reference: Http://blog.csdn.net/oneyearlater/article/details/6324403

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.