Download ant from here: http://ant.apache.org/bindownload.cgi
$ tar -zxvf apache-ant-x.x.x-bin.tar.gz
$ su -c "mv apache-ant-x.x.x /opt/ant-x.x.x"
Open .bash_profile and add:
export ANT_HOME=/opt/ant-x.x.x
PATH=$PATH:$ANT_HOME/bin
Install Maven
Download maven from here: http://maven.apache.org/download.html
$ tar -zxvf apache-maven-x.x.x-bin.tar.gz
$ su -c "mv apache-maven-x.x.x /opt/maven-x.x.x"
Open .bash_profile and add:
export MAVEN_HOME=/opt/maven-x.x.x
PATH=$PATH:$MAVEN_HOME/bin
$ source ~/.bash_profile
It is better to add these strings to ~/.profile
ReplyDeleteIn recent Ubuntu and Debian versions default shell /bin/sh is not equal to /bin/bash (or whatever bash resides). So when you launch Eclipse it receives environment from X11, that receive environment from default shell. So if you launch maven3 inside Eclipse you will get warning "MAVEN_HOME not set".
If you have several users on the machine that all need some common environment use /etc/profile