I have to build and compile my project through Putty(through a remote linux environment). I am unable to execute maven commands(such as mvn compile, mvn test etc) in Putty as it cannot identify "mvn" as a command. For this I need to install maven in my remote system. How do I do it?
Asked
Active
Viewed 1,908 times
-1
-
I have an extracted file of maven in my remote. I am trying to add the environment variables using these commands: export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.1 export M2=$M2_HOME/bin export PATH=$M2:$PATH It says permission denied when I check maven using mvn -version. Any help? – Ashish Abhishek May 20 '15 at 06:43
2 Answers
1
Is putty used to connect via ssh to the remote computer? If you are logged in type the following command in the terminal:
curl http://apache.panu.it/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz > maven.tar.gz
Then follow instruction on site to install it: LINK
You can also use sudo apt-get install maven
but I don't know which version is on repository.

LPs
- 16,045
- 8
- 30
- 61
-
yes via ssh. this command results incurl: (6) Couldn't resolve host 'apache.panu.it' – Ashish Abhishek May 19 '15 at 06:29
-
I did the command in m terminal and it works well. My mirror is in Italy, find out the file on the correct/preferred mirror [HERE](https://maven.apache.org/download.cgi) – LPs May 19 '15 at 06:32
-
-
I'm not getting you... If you are connected with ssh to the remote computer, and you have root/sudo access, you can download the file directly to the remote computer and then install it there. – LPs May 19 '15 at 06:38
-
probably you need sudo before. I mean `sudo curl http://apache.panu.it/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz > maven.tar.gz` or `sudo apt-get install maven` – LPs May 19 '15 at 06:40
0
sudo apt-get update
sudo apt-get install maven
That is, if you have Ubuntu.
How to install maven2 on redhat linux
there is a thread for maven on red hat.
-
-
-
I have an extracted file of maven in my remote. I am trying to add the environment variables using these commands: export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.1 export M2=$M2_HOME/bin export PATH=$M2:$PATH – Ashish Abhishek May 20 '15 at 06:41