Install Java 10.04 Java 1.5 on Ubuntu 1.6

Source: Internet
Author: User
Install Java 10.04 Java 1.5 on Ubuntu 1.6

11:00:05 | category: Embedded Linux | font size subscription


Installing the JDK

The Sun JDK is no longer in Ubuntu's main package repository. In order to download it, you need to add the appropriate repository and indicate to the system which JDK shoshould be used.

Java 6: For gingerbread and newer

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"$ sudo add-apt-repository "deb-src http://archive.canonical.com/ubuntu lucid partner"$ sudo apt-get update$ sudo apt-get install sun-java6-jdk

Java 5: for froyo and older

$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu dapper main multiverse"$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu dapper-updates main multiverse"$ sudo apt-get update$ sudo apt-get install sun-java5-jdk
Add/etc/APT/source. List
In Java 1.5
Http://cz.archive.ubuntu.com/ubuntu dapper main multiverse
In Java 1.6
  1. Sudo apt-add-repository "Deb http://archive.canonical.com/lucid partner"
Then install
Sudo apt-Get update

$ Sudo apt-Get install sun-java5-jdk
Finally, set the Java environment
Ln-S/usr/lib/JVM/Java-6-sun/bin/javac/etc/alternatives/javac
Ln-S/usr/lib/JVM/Java-6-sun/bin/Java/etc/alternatives/Java

Ln-S/usr/lib/JVM/Java-1.5.0-sun/bin/javac/etc/alternatives/javac
Ln-S/usr/lib/JVM/Java-1.5.0-sun/bin/Java/etc/alternatives/Java
Sudo ln-S/usr/lib/JVM/Java-1.5.0-sun/bin/javadoc/etc/alternatives/javadoc

$ Sudo Update-alternatives -- config Java
$ Sudo Update-alternatives -- config javac
Java-version
Javac-version

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.