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