包括Mahout数学库的核心和amp;数学文件夹-Eclipse-Hadoop [英] Include classes of Mahout math libraries of both core & math folders - Eclipse - Hadoop

查看:106
本文介绍了包括Mahout数学库的核心和amp;数学文件夹-Eclipse-Hadoop的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题与此类似:如何在不使用以下代码的情况下构建/运行这个简单的Mahout程序得到异常?,但是要复杂一些.

My issue is similar to this one : How do I build/run this simple Mahout program without getting exceptions? , but a bit more complicated.

我正在编写hadoop代码,并想使用Mahout数学库(例如SparseRowMatrix和VectorWritable类).

I am writing hadoop code, and would like to use Mahout math libs (e.g. SparseRowMatrix & VectorWritable classes).

问题在于,前一个示例类位于Mahout的最新SNAPSHOT的math文件夹中,而后者位于核心文件夹下-两者共享与根文件夹之后的点相同的路径(org.apache.mahout .math).

The problem is that the former example class lies at math folder of latest SNAPSHOT of Mahout, while the latter is placed under core folder - and both share the same path as of the point after the root folder (org.apache.mahout.math).

问题在于,我没有办法制作hadoop jar文件来正确导入与数学相关的类,但是位于Mahout项目的 Core 文件夹下.

The problem is that I have found no way to make hadoop jar file to import properly the classes that concern math stuff, but lie under the Core folder of Mahout project.

我正在使用Eclipse并成功运行我的工作,每次导出一个新jar时,我都会搜索核心文件夹&的类路径树.将相应的数学文件夹捆绑到我的项目中.

I am working with Eclipse and to run successfully my jobs, I have ,each time I export a new jar, to search down the classpath tree of core folder & bundle the respective math folder into my project.

如果有人可以帮助我避免执行此过程,我将不胜感激.在此先感谢:-)

If anyone could help me avoid this procedure, I would be grateful. Thanks in advance :-)

推荐答案

您是在Eclipse项目中直接使用Mahout代码,还是在使用其他构建工具? 我建议使用基于Maven的项目,并在其中声明对所需Mahout版本的依赖.另外,您还将能够创建带区卷的作业jar,就像为《行动中的行动》中的示例所完成的一样.-看看那里的pom.xml ...

Are you using Mahout code directly in Eclipse project, or you're using other build tool? I would recommend to use maven-based project, and declare dependency on needed Mahout version in it. Plus you'll get ability to create striped job jar, like this was done for examples from book 'Mahout in Action' - look onto pom.xml there...

eclipse中对Maven的支持是通过m2eclipse插件实现的...

Maven support in eclipse is implemented through m2eclipse plugin...

这篇关于包括Mahout数学库的核心和amp;数学文件夹-Eclipse-Hadoop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆