使用Univocity时出现NoClassDefFound错误

问题描述

import com.univocity.parsers.csv.*;    
import com.univocity.parsers.common.record.Record;

public void assignRows(File dataFile) throws UnsupportedEncodingException,FileNotFoundException {
    CsvParserSettings settings = new CsvParserSettings();
    settings.getFormat().setLineseparator("\n");
    CsvParser rowParser = new CsvParser(settings);
    settings.setLineseparatorDetectionEnabled(true);
    settings.setHeaderExtractionEnabled(true);
    String filePath = dataFile.getAbsolutePath();
    List<Record> allRecords = rowParser.parseAllRecords(getReader(filePath));
    for (Record record : allRecords) {
        Date classDate = record.getDate("Section_Start_Date");
        System.out.println(classDate);
    }
}

我只是在使用我发现的教程,以查看代码的全部工作原理,因此可能从某个地方看起来很熟悉。 (我将导入移动到该方法上方只是为了显示我在帖子中使用的导入)。尝试使用univocity库时,我似乎无法摆脱此错误。我已经导入了外部JAR文件,尝试使用快照构建并将javadoc,源等链接到构建路径。有想法吗?

Link to picture

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)