Edwin Yeo
Edwin Yeo

Reputation: 165

Import CSVReader in java

I'm trying to import the CSVReader into my Java project, but when I tried to build the project, it says that 'The import au cannot be resolved'.

I've added the opencsv-3.3.jar into my build path, and have imported the following in my source code.

import au.com.bytecode.opencsv.CSVReader;
import au.com.bytecode.opencsv.bean.ColumnPositionMappingStrategy;
import au.com.bytecode.opencsv.bean.CsvToBean;

What else could be missing or wrong that causes this issue?

Upvotes: 1

Views: 31144

Answers (1)

SubOptimal
SubOptimal

Reputation: 22973

You need to take the rigth Jar. For example you can take it from here mvnrepository.com

This contains the packages au.com.bytecode.opencsv and the repository is located at https://github.com/EmergentOrder/opencsv which is a fork of https://code.google.com/p/opencsv/

The project on https://code.google.com/p/opencsv/ provide the packages com.opencsv

Depending which project you want to use. Maybe changing the package name in the import statement would fix it (when opencsv-3.3.jar is the Jar you need to use).

Upvotes: 2

Related Questions