0

I am trying to do a simple Dataset and saving it to a file.

    Dataset data = new DefaultDataset();
    for (int i = 0; i < 1; i++) {
        Instance tmpInstance = InstanceTools.randomInstance(999);
        data.add(tmpInstance);
    }
    System.out.println(data);
    try {
        net.sf.javaml.tools.data.FileHandler.exportDataset(data, new File("save.data"));
    } catch (IOException e) {
        e.getMessage();

The dataset is good created and I can print it, but when trying to save the dataset to a file it fails with the next error:

Exception in thread "main" java.lang.NoClassDefFoundError: be/abeel/io/GZIPPrintWriter
    at prueba.generador.dataset(generador.java:27)
    at prueba.generador.main(generador.java:16)
Caused by: java.lang.ClassNotFoundException: be.abeel.io.GZIPPrintWriter
    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)
    ... 2 more
Asier Gomez
  • 6,034
  • 18
  • 52
  • 105

1 Answers1

2

ClassNotFoundException means you are missing a library in the classpath. When we check the missing class, library you need to import is ;

http://sourceforge.net/projects/ajt/

After downloading, follow the instructions here

How do I add jar files to the Classpath?

Dogukan Zengin
  • 545
  • 3
  • 11