14.04中彻底清除maven

fcg9iug3  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(340)

我使用的是ubuntu-14.04、maven-3.2.3、mahout-0.9、hadoop-2.2.0。我是Maven的新手。我试过在hadoop上运行mahout。那次我遇到了一个错误,比如找不到mahout-core-0.9的hadoop-core-2.2.0。所以我搜索并找到了一个键,因为我需要提到与hadoop相关的mahout类路径。所以我通过在open terminal中使用“export”更改了mahout的路径(不在任何.bashrc或/etc/profile-like中)。从那以后,我再也找不到我改变的环境路径了。我试过以下方法,

mansoor@mansoor:~$ mvn --version
The program 'mvn' can be found in the following packages:
 * maven
 * maven2
Try: sudo apt-get install <selected package>

所以我两样都试过了

mansoor@mansoor$ sudo apt-get install maven ( maven2)

如果我尝试安装新的,我会得到以下结果,

mansoor@mansoor:~$ mvn -v
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.classworlds.Launcher
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.codehaus.classworlds.Launcher.  Program will exit.

我把maven的都拿走了我试着

$ mvn -v / and with (--version)

我又犯了同样的错误,

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

用过之后我尝试了新的安装

sudo apt-get remove maven(maven2)

使用从apache站点下载的maven包。那一次我也犯了同样的错误。
我检查了所有我知道的路径和环境变量,比如bellow,

mansoor@mansoor:~$ which mvn
mansoor@mansoor:~$ which maven
mansoor@mansoor:~$ which maven2
mansoor@mansoor:~$ whereis mvn
mvn:
mansoor@mansoor:~$ whereis maven
maven:
mansoor@mansoor:~$ whereis maven2
maven2:
mansoor@mansoor:~$ sudo gedit ~/.bashrc
==> Here there is no maven variable mentioned 
mansoor@mansoor:~$ sudo gedit ~/.bash_profile
mansoor@mansoor:~$ sudo gedit /etc/profile
/usr/bin$ ls
==> here also no maven 
/usr/share$ ls
==> here also no maven

一切都是空的,这意味着没有专业人士。我不知道如何完全清洁maven和重新安装它新的。有人能帮我解决这个问题吗?

xghobddn

xghobddn1#

试试这个博客,它解释了如何在ubuntu中设置mahaut

相关问题