Nishadh KA

Installing maven in Ubuntu 1204

2013-10-08


Based on links

  1. http://docs.geotools.org/latest/userguide/build/install/mvn.html
  2. http://www.mkyong.com/maven/how-to-install-maven-in-ubuntu/
  3. http://lukieb.wordpress.com/2011/02/15/installing-maven-3-on-ubuntu-10-04-lts-server/

Download, untar and copy maven in /usr/local/

wget http://archive.apache.org/dist/maven/binaries/apache-maven-3.0.4-bin.tar.gz
tar -zxf apache-maven-3.0.4-bin.tar.gz
sudo cp -R apache-maven-3.0.4 /usr/local 
  1. then link with bin folder

    sudo ln -s /usr/local/apache-maven-3.0.4/bin/mvn /usr/bin/mvn

  2. Then add java home link in the .bashrc sudo nano .bashrc

    ---JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64 Thats it maven is installed Test it

  3. mvn –version

  4. Seems every think ok but there will be an issue while mvn install, the error of

    javac": java.io.IOException: error=2, No such file or directory javac not found type javac – version in terminal it will say no javac in computer

  5. javac --version gives

    The program 'javac' can be found in the following packages: default-jdk ecj gcj-4.6-jdk openjdk-6-jdk gcj-4.5-jdk openjdk-7-jdk

  6. So doing sudo apt-get install default-jdk, the error goes away