Ubuntu12.04 error: Update-Alternatives: Error: No Java candidate.

Source: Internet
Author: User

In the past two days, I wanted to develop the android development environment in Linux, But I encountered a big problem when installing Sun's Java 6.

The source cannot be found.

The final installation method is to download the binfile of Java 6 on the official website, modify the/etc/profile file, and specify the location of Java, so that the Java command is available.

Then you need a command to specify which software the Java command is provided, that is, the default software. The reason for this setting is that you are afraid that your computer has installed several Java

For example, openjdk that comes with ubuntu (which is not installed by default), java5, and java6.

Update-alternatives -- config Java

This command is used to set the Java default software, similar to setting the default software in windows.

However, the following error occurs during execution.

Root @ jack-desktop: stream_src # Update-alternatives -- config javaupdate-Alternatives: Error: No Java candidate item.

The solution is as follows:

Root @ jack-desktop: /usr/bin # Update-alternatives -- install/usr/bin/Java/usr/local/share/JVM/jdk1.6.0 _ 45/bin/Java 1888 Update-alternatives: use/usr/local/share/JVM/jdk1.6.0 _ 45/bin/Java to provide/usr/bin/Java (Java) in automatic mode. Root @ jack-desktop:/usr/bin # Update-alternatives -- config Java link group Java contains only one candidate item: /usr/local/share/JVM/jdk1.6.0 _ 45/bin/Java requires no configuration. Root @ jack-desktop:/usr/bin # Java-versionjava version "1.6.0 _ 45" Java (TM) se Runtime Environment (build 1.6.0 _ 45-b06) Java hotspot (TM) client VM (build ipv45-b01, mixed mode, sharing)

OK!

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.