Set up sun-jdk and Maven2 in Ubuntu

Source: Internet
Author: User
Environment Description: UbuntuServer12.04/java-6-sun-1.6.0.06/apache-maven-3.0.41, install sun-jdk because sun-jdk was acquired by Oracle, so Ubuntu supports open source, currently, there is no update source for the new version of oraclejavajdk. To install sun-jdk, you must install the old version and update the Ubuntu download source as follows: & gt;

Environment Description: Ubuntu Server 12.04/java-6-sun-1.6.0.06/apache-maven-3.0.4

1. Install sun-jdk

Because sun-jdk has been acquired by Oracle, Ubuntu supports open source. Currently, there is no update source for the new version of oracle java jdk. Therefore, to install sun-jdk, you must only install the old version, you must update the Ubuntu download source as follows:

Installation required

> Apt-get install python-software-properties

Update the download source of the sun-6-jre to sources. list
> Add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ hard multiverse"

Then you can directly install the SDK through the command line. Before installation, you must update the apt-get update list.

> Apt-get install sun-java6-jdk

In general, Ubuntu server will install openjdk by default, so here we want to change the jdk priority and command link as follows:

> Update-alternatives -- install/usr/bin/java/usr/lib/jvm/java-6-sun-1.6.0.06/bin/java 300

> Update-alternatives -- install/usr/bin/javac/usr/lib/jvm/java-6-sun-1.6.0.06/bin/javac 300

Next, modify the default JDK.

> Sudo update-alternatives -- config java. Select the default jdk as follows:

There are 3 choices for the alternative java (providing/usr/bin/java ).

Selection Path Priority Status
------------------------------------------------------------
0/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 auto mode
1/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
* 2/usr/lib/jvm/java-6-sun-1.6.0.06/bin/java 300 manual mode
3/usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode

Press enter to keep the current choice [*], or type selection number: select 2 here.

So far, sun-jdk is installed on/usr/lib/jvm/java-6-sun-1.6.0.06 by default.

 

2. Install maven2

To begin

Upload apache-maven-3.0.4-bin.tar.gz to the/usr/share directory and decompress the package using the following command:

> Tar-zxvf apache-maven-3.0.4-bin.tar.gz to/usr/share/apache-maven-3.0.4

Now maven installation is complete

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.