A
A
Anton @ Lyalin2017-01-19 12:49:11
Java
Anton @ Lyalin, 2017-01-19 12:49:11

How to fix opencsv error?

I get an error

Exception in thread "main" java.lang.NoClassDefFoundError: au/com/bytecode/opencsv/CSVWriter

Write lines to csv file.
csvWriter = new CSVWriter(new FileWriter(new File(FILEOUT), true));
        try {
            csvWriter.writeNext(StringArray);

            csvWriter.flush();

        } catch (Exception e){
            System.out.println("Не удалось записать данные в файл");
        } finally {
           if (csvWriter != null){
               try {
                   csvWriter.close();
               } catch (Exception e){
                   e.printStackTrace();
               }
           }
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Alexandrov, 2017-01-19
@toxa_1995

Add commons-lang3 to dependencies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question