by default ubuntu comes with openjdk. I installed jdk from sun, and removed openjdk, but with openjdk I had to remove maven2. How can I reinstall it without installing openjdk?
~$ java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) Server VM (build 22.1-b02, mixed mode)
~$ sudo apt-get install maven2
(...)
The following extra packages will be installed:
(...)
openjdk-6-jdk openjdk-6-jre openjdk-6-jre-headless
openjdk-6-jre-lib
(...)
The following NEW packages will be installed:
(...)
openjdk-6-jdk openjdk-6-jre openjdk-6-jre-headless
openjdk-6-jre-lib
Any help appreciated, I have googled a lot and I haven’t found any solution :/
You can simply download tar.gz archive from Maven web-site and unpack it to some directory like this (will unpack it to /opt):
After it you need to set
$M2_HOMEvariable:And add it to
PATH:To check you can launch:
Note:
If it does not work for all the terminals.
Performed the below steps.
Become superuser.
Fire below commands.
Paste the below lines.
export M2_HOME=<path_to_maven>export PATH=$PATH:$M2_HOME/binctrl +Oto save andctrl +Xto exit.Fire the below commands.