I added the opencsv jar to my classpath
My code is as follows:
import java.io.File;
import java.io.FileReader;
import java.io.FileOutputStream;
import com.opencsv.CSVReader;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import java.util.Scanner;
public class CreateDocument
{
public static void main(String[] args)throws Exception
{
CSVReader reader = new CSVReader(new FileReader("invoicedetails.csv"));
String [] nextLine;
while ((nextLine = reader.readNext()) != null) {
// nextLine[] is an array of values from the line
System.out.println(nextLine[0] + nextLine[1] + nextLine[2]);
}
}
}
Now the problem occurs when I try to run the jar from command line, I create the jar by clicking build -> build artifacts
I get the following message in my commmand line:
For some extra clarity this is how my solution looks like in IntelliJ: