1
votes

I apologize, this seems like it is really simple but I can't seem to get it.

I've downloaded the Windows version of WEKA and installed it, but I can't seem to call it from the command line.

I've added a WEKAHOME environment variable, pointing to the directory containing weka.jar, and added that to my path with /weka.jar appended to it..

I am trying this command: java weka.classifiers.j48.J48 -t %WEKAHOME%/data/iris.arff

I then get the following error output.

Exception in thread "main" java.lang.NoClassDefFoundError: weka/classifiers/j48/ J48 Caused by: java.lang.ClassNotFoundException: weka.classifiers.j48.J48 at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: weka.classifiers.j48.J48. Program will exit.

What can I do to fix this?

1
Did you set the java classpath correctly?Has QUIT--Anony-Mousse

1 Answers

3
votes

It's because of this weka.classifiers.j48.J48, that is an error in the Weka documentation, it should be: weka.classifiers.trees.J48

(Note: the comments below are no longer relevant. The answer here works, and remember to set the classpath as Thomas Jungblut says below.)