ubuntu14.10 安装maven出现The program 'mvn' can be found in the following packages错误
来源:互联网 发布:ict网络集成 编辑:程序博客网 时间:2024/05/16 05:31
这几天准备搭建持续集成平台,使用maven作为集成工具。平台环境:
ubuntu14.10 X64
maven3.2.5
下载maven后,通过命令解压并放在/usr/local目录下
使用 gedit ~/.profile(注意,我使用的不是root用户)
按照官网的方式进行了环境变量配置,这里贴出官网配置内容
Unix-based Operating Systems (Linux, Solaris and Mac OS X)
- Extract the distribution archive, i.e.apache-maven-3.2.5-bin.tar.gz to the directory you wish to install Maven 3.2.5. These instructions assume you chose/usr/local/apache-maven. The subdirectory apache-maven-3.2.5 will be created from the archive.
- In a command terminal, add the M2_HOME environment variable, e.g. export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.5.
- Add the M2 environment variable, e.g. export M2=$M2_HOME/bin.
- Optional: Add the MAVEN_OPTS environment variable to specify JVM properties, e.g.export MAVEN_OPTS="-Xms256m -Xmx512m". This environment variable can be used to supply extra options to Maven.
- Add M2 environment variable to your path, e.g. export PATH=$M2:$PATH.
- Make sure that JAVA_HOME is set to the location of your JDK, e.g. export JAVA_HOME=/usr/java/jdk1.7.0_51 and that $JAVA_HOME/bin is in yourPATH environment variable.
- Run mvn --version to verify that it is correctly installed.
这里除了6,7步我在装jdl时已经配好,其它的就是按照此步骤配置。注意M2_HOME的路径。我是直接解压到local,所以是/usr/local/apache-maven-3.2.5.和官网有差别
一切结束后,启动terminal(终端)输入 mvn --version出现
The program 'mvn' can be found in the following packages: * maven * maven2Try sudo apt-get install <selected-page>开始怀疑是不是解压出错。检查了很久,后来进入到/usr/local/apache-maven-3.2.5/bin目录下执行mvn发现一切正常,说明安装没有问题。最后使用export命令发现PATH里没有maven的路径,百思不得其解,在http://askubuntu.com/questions/310059/ubuntu-adding-path-environment-variables 这里找到答案,每次修改了环境配置后需要使用source命令更新一下:source ~/.profile.
再次使用export看到输出的path里包含了maven的路径。使用mvn --version一切正常。
最后希望遇到有此类问题的初学者能解决问题。这里需要注意,我修改的是.profile文件,所以更新的是.profile,如果你修改的是其它环境文件,请更新对应的文件。否则无效。在上面给出的链接里有描述。
0 0
- ubuntu14.10 安装maven出现The program 'mvn' can be found in the following packages错误
- ubuntu 安装maven提示出错 The program 'mvn' can be found in the following packages
- The program 'java' can be found in the following packages
- Ubuntu配置JDK出现的The program 'java' can be found in the following packages
- nginx报错The program 'nginx' can be found in the following packages
- the program javac can be found in the following packages ubuntu
- [Ubuntu] 解决The program 'make' can be found in the following packages:
- 解决Linux下svn问题:The program 'svn' can be found in following packages...
- mysql:The package 'mysql' can be found in following packages
- The program 'node' can be found in the following packages: * node * nodejs-legacy Try: sudo apt-ge
- linux使用mysql 在输入了mysql 之后出现 the programe can be found in the following packages
- Linux matplotlib 库安装 * The following required packages can not be built: * freetype, png
- 安装基于python3的numpy时,出现WARNING: The following packages cannot be authenticated.
- can not be found in source packages. Check the inheritance chain from your module
- Question 10: Given the following program snippet, what can we conclude about the use of dynamic_cast in C++?
- Linux使用yum安装时出现The program package-cleanup is found in the yum-utils package.解决方法
- 【常见错误】布局文件添加edittext报:The following classes could not be found错误
- 安卓错误提示:The following classes could not be found: - LinerLayout
- ListView嵌套EditText冲突
- 5、SVN学习之svn与myeclipse10.0集成
- aotulayout 动态计算cell高度
- 百度地图SDK和百度导航SDK合并冲突问题
- 类常量
- ubuntu14.10 安装maven出现The program 'mvn' can be found in the following packages错误
- Xcode快捷键
- 位图的读取与保存 C语言 源文件+头文件
- iOS Webview 实现修改javascript confirm 和 alert
- 十年一梦 血泪史5
- javascript和CSS嵌入式写法
- 理解Linux系统/etc/init.d目录和/etc/rc.local脚本
- Myeclipse中如何移出Capabilities??
- 英文站外链查询工具