Search code examples
javaeclipseclassificationwekalibsvm

Weka installing libsvm


I'm trying to use libsvm in weka from java. I've added the libsvm jar to classpath, including the weka jar.

Weka version: 3-6

Image here: http://tinypic.com/r/14xhycz/8

Libsvm works in the weka user interface, but I still have the error 'libsvm classes not in classpath', when trying to use weka in java.

I haven't included 'WLSVM' because I haven't been able to download it (website down at the moment: http://www.cs.iastate.edu/~yasser/wlsvm/). Do I need to download this for libsvm to work?

I've restarted Eclipse a number of times, not that this would make a different I'm sure.

Does anyone have any ideas on how to get it working?


Solution

  • You should use an appropriate reference path to the lib in your Eclipse project. So, go to Eclipse Luna for example (check the appropriate way to include in others versions here), and then enable support for your library.

    Project(Alt+Enter) >> Java Build Path >> Add JARs

    or

    Project(Alt+Enter) >> Java Build Path >> Add External JARs

    I prefer the first approach, because I can put a library inside the project as a lib folder and then pick it on Eclipse menu options.