I keep getting a "NoClassDefFound" error with Weka Ai using Java. I keep getting this Error?

25 Views Asked by At

I'm new at weka and Ai. And, I dont understand why I keep getting the "Exception in thread "main" java.lang.NoClassDefFoundError: weka/core/converters/ConverterUtils$DataSource"? The file in the DataSource object has the correct path?

import weka.*;
import weka.core.Instances;
import weka.core.converters.ArffSaver;
import weka.core.converters.ConverterUtils.DataSource;
import java.io.File;




public class XiWeather  {

    public static void main(String[] args) throws Exception  {
        
        
    
DataSource dataSrc = new DataSource("C:\\Program Files\\Weka-3-8-6\\data\\weather.numeric.arff");
Instances instances = dataSrc.getDataSet( );
System.out.println(instances.toSummaryString( ));
ArffSaver arffSvr = new ArffSaver( );

     
  arffSvr.setInstances(instances);
  arffSvr.setFile(new File("weather.arff"));
  arffSvr.writeBatch( );

   }
     }
0

There are 0 best solutions below