invocationtargetexception

invocationtargetexception

本文介绍了Weka类无法初始化:InvocationTargetException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次使用 weka ,如果我的问题似乎天真​​,我很抱歉。但是我真的坚持这个问题。

This is my first time using weka, I am sorry if my question seems naive. But I was really stuck by this problem.

我在我自己的 java 项目中使用 weka eclipse 中。我已成功导入 weka.jar 附加的 wekasource.jar 。但是当我运行程序时,所有的 weka 类总是无法初始化(属性,Fastvector等)。所有异常是相同的:

I am using weka in my own java project in eclipse. I have successfully import weka.jar with attached wekasource.jar. But when I ran the program, all the weka class always failed to be initialized(attribute, Fastvector etc.). All the exceptions are the same:

InvocationTargetException

我检查显示的错误堆栈:java.lang.NoClassDefFoundError:weka / core / attribute

I check the error stack where showed: java.lang.NoClassDefFoundError: weka/core/attribute

附加信息:我试图在eclipse中创建一个新项目,并使用weka,它的工作原理。但是,在我自己现有的项目中仍然无法工作。

Additional Info: I tried to create a new project in eclipse ,and use weka, it works. But it still can not work in my own existing project.

有没有人有一些想法应该如何解决这个问题?

Does anyone have some ideas how should I solve this problem?

推荐答案

p>似乎我已经解决了这个奇怪的问题。解决方案很简单:

It seems I have solved this weird problem. The solution is simple:

右键单击项目,在java构建路径中,按顺序检查weka.jar和导出选项卡。

right click on the project, in the java build path, check weka.jar in order and export tab.

希望它可以帮助面临类似问题的后来的人们

Hope it can help the later people who face the similar problem

这篇关于Weka类无法初始化:InvocationTargetException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 18:43