Weka class cannot be initialized: InvocationTargetException

喜你入骨 提交于 2019-12-12 01:52:36

问题


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

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

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

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?


回答1:


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

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



来源:https://stackoverflow.com/questions/17399901/weka-class-cannot-be-initialized-invocationtargetexception

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!