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

问题:

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
 * maven2
Try 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 --version
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T21:51:42+08:00)
Maven home: /usr/local/apache-maven-3.2.2
Java version: 1.7.0_55, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-29-generic", arch: "amd64", family: "unix"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值