Ubuntu: Program ' Java ' has been included in the following packages for workaround

Source: Internet
Author: User

Already installed Sun Java in the terminal to enter Java, the following prompt appears:

The program ' Java ' is already included in the following packages:
* DEFAULT-JRE
* Gcj-4.8-jre-headless
* Gcj-4.9-jre-headless
* Openjdk-7-jre-headless
* Openjdk-6-jre-headless
* Openjdk-8-jre-headless
Please try: Apt-get Install < selected packages >

Enter Javac in the terminal the following prompt appears:
The program ' Javac ' is already included in the following packages:
* DEFAULT-JDK
* ECJ
* GCJ-4.8-JDK
* GCJ-4.9-JDK
* OPENJDK-7-JDK
* OPENJDK-6-JDK
* OPENJDK-8-JDK
Please try: Apt-get Install < selected packages >

Workaround:

sudo update-alternatives--install/usr/bin/javac javac /usr/local/java/jdk1.7.0_80/bin/javac 300

sudo update-alternatives--install/usr/bin/java java /usr/local/java/jdk1.7.0_80/bin/java 300

Marked red is the path to the Java installation

Ubuntu: Program ' Java ' has been included in the following packages for workaround

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.