ubuntu 安裝maven提示出錯 The program 'mvn' can be found in the following packages

來源:互聯網
上載者:User

問題:

I am trying to install apache maven 3 in Ubuntu 12.04 lts. What I did was open the terminal then I typed the following commands

  • export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.5 [Then pressed Enter]
  • export M2=$M2_HOME/bin [Then pressed Enter]
  • export PATH=$M2:$PATH [Then pressed Enter]

After that I typed

mvn --version

and it displayed all the necessary information but after closing the terminal, again I typed the command mvn --version


The program 'mvn' can be found in the following packages: * maven * maven2Try sudo apt-get install <selected-page>


解決方案如下http://askubuntu.com/questions/310059/ubuntu-adding-path-environment-variables


問題是在環境裡面添加了PATH,但是需要

$source /etc/environment
然後mvn --vsersion
xx@xxx:/usr/local$ mvn --versionApache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T21:51:42+08:00)Maven home: /usr/local/apache-maven-3.2.2Java version: 1.7.0_55, vendor: Oracle CorporationJava home: /usr/lib/jvm/java-7-openjdk-amd64/jreDefault locale: en_US, platform encoding: UTF-8OS name: "linux", version: "3.13.0-29-generic", arch: "amd64", family: "unix"

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.