本文介绍了运行Mahout本地获取MahoutDriver的ClassNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Windows 8计算机上本地运行Mahout(没有Hadoop)。我意识到这不是最佳的设置,但这是我必须与之合作。

I am trying to run Mahout locally (without Hadoop) on a Windows 8 Machine. I realize this is not the optimal set up but that's what I've got to work with.

当我尝试运行 bin / mahout 时,出现以下错误:

When I try to run bin/mahout I get the following error:

$ bin/mahout
MAHOUT_LOCAL is set, so we don't add HADOOP_CONF_DIR to classpath.
no HADOOP_HOME set, running locally
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/mahout/dri
ver/MahoutDriver
Caused by: java.lang.ClassNotFoundException: org.apache.mahout.driver.MahoutDriv
er
    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.apache.mahout.driver.MahoutDriver.  Program w
ill exit.

我已经尝试下载源文件并使用maven安装并使用预编译的分发文件,这里:

I've tried both downloading the source and installing with maven and using the precompiled distribution files, both provided here: http://www.poolsaboveground.com/apache/mahout/

我也尝试过0.7和0.6 Mahout版本,并得到同样的问题。不知道它是否与我的Java版本有关,但我使用的是:1.7.0_09。我还设置了环境变量 MAHOUT_LOCAL = true MAHOUT_HEAPSIZE = 128

I've also tried with both the 0.7 and 0.6 Mahout versions and gotten the same issue. Not sure if it has anything to do with my java version but I'm using: 1.7.0_09. Also I've set the environment variables MAHOUT_LOCAL = true and MAHOUT_HEAPSIZE=128

推荐答案

我从来没有成功地从二进制包运行mahout,它似乎并不是一个独立的包。最简单的方法是从源代码进行编译,只要安装了Maven,它就非常简单:

I never succeded in runing mahout from binary package and it seems that it isn't really a standalone package. Easiest way is to compile from source which is pretty straight forward as far as you have Maven installed:

mkdir mahout
cd mahout/
svn co http://svn.apache.org/repos/asf/mahout/trunk
cd trunk/
mvn compile
mvn install
export MAHOUT_LOCAL=TRUE
export MAHOUT_HEAPSIZE=1000

然后你可以使用这个非常详细的例子来测试您的安装是否正常:

then you can use this very detailed example to test that your installation is ok: http://www.cs.ucy.ac.cy/courses/EPL660/labs/Stalo/Lab8.pdf

这篇关于运行Mahout本地获取MahoutDriver的ClassNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 15:07