问题描述
我用的apt-get安装了maven2
安装的 maven2.2.1 的。为了编译的的Hadoop 2.1.0 的源程序,我需要升级的的Maven 的版本,但它不能使用 apt-get的
再次,因为的 maven2.1.0 的是在lib最新的。
I have used apt-get install maven2
to install maven2.2.1. In order to compile hadoop 2.1.0 source program, I need to upgrade the maven version, but it is not able to use apt-get
again, because maven2.1.0 is the latest in the lib.
我下载的Apache Maven的-3.0.5-bin.tar.gz
从官方网站上,跑到焦油Apache的Maven的3.0。 5 bin.tar.gz
在路径的/ usr /本地
,把 Apache的行家
链接的的Apache Maven的-3.0.5 的:
I downloaded apache-maven-3.0.5-bin.tar.gz
from the official website, ran tar apache-maven-3.0.5-bin.tar.gz
at the path /usr/local
, and put apache-maven
links to apache-maven-3.0.5:
lrwxrwxrwx 1 root root 18 Dec 8 11:26 apache-maven -> apache-maven-3.0.5
drwxr-xr-x 6 root root 1024 Dec 8 11:12 apache-maven-3.0.5
export the order in the terminal like this:
export M2_HOME=/usr/local/apache-maven
export PATH=$PATH:$M2_HOME/bin
输入命令出口,以确定:
input order "export" to identify :
.............................................
declare -x M2_HOME="/usr/local/apache-maven"
declare -x MANDATORY_PATH="/usr/share/gconf/ubuntu.mandatory.path"
declare -x OLDPWD="/usr"
declare -x PATH="/usr/lib/lightdm/lightdm:/usr/local/java/latest/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/apache-maven/bin"
所有的迹象显示的的Maven 3.0.5 的已经成功地配置,但是当我输入
All signs showed maven 3.0.5 has succeeded in configuration, but when I input
MVN -version
在终端,它表明这样的错误:
in the terminal, it show errors like this:
Error: Could not find or load main class org.codehaus.classworlds.Launcher
如果我换一个新的终端并输入 MVN -version
,它表明:
If I change a new terminal and input mvn -version
, it shows:
administrator@ubuntu:~$ mvn -version
Apache Maven 2.2.1 (rdebian-8)
Java version: 1.7.0_45
Java home: /usr/local/java/jdk1.7.0_45/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "3.5.0-17-generic" arch: "amd64" Family: "unix"
它运行情况,每次虽然我已经卸载的的Maven 2.2.1 的:
sudo易于得到删除--purge行家
我不知道为什么?我还没有完全卸载呢?
I do not know why? I have not uninstalled it completely?
推荐答案
我得到这个错误了。原来我忘了重新启动我的外壳。
I got this error too. Turns out I had forgotten to restart my shell.
一旦我关闭终端,打开了一遍,错误没有回来和Maven的工作。
Once I closed Terminal and opened it again, the error did not come back and Maven worked.
这篇关于错误:构建的Maven 3.0.4无法找到或加载主类组织codehaus.classworlds.Launcher。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!