-1

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?

  • 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 Answers2

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 am able to download the file but not through putty. – Ashish Abhishek May 19 '15 at 06:36
  • 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.

Community
  • 1
  • 1
Fl.pf.
  • 324
  • 1
  • 5
  • 18
  • what Linux distribution do you have installed on your remote? – Fl.pf. May 19 '15 at 06:47
  • you need to include such information in your question. – Fl.pf. May 19 '15 at 12:32
  • 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