I m new to java and using Netbeans IDE for my project. I need to read and display csv files so i used opencsv library for that. it is working fine on my computer but the jar file is not able to load any csv file on a different machine. what could be the reason? what should I do to resolve this problem?
code for reading csv file
try{
CSVReader reader = new CSVReader(new FileReader(dataFile));
String [] nextLine;
row = 0;
ArrayList<String[]> ls = new ArrayList<>();
while ((nextLine = reader.readNext()) != null) {
row++;
ls.add(nextLine);
}
col=ls.get(0).length;
String[] tempHeader=new String[col];
for(int i=0;i<col;i++)
tempHeader[i]=(String)("ATT"+(i+1));
fileData=new String[row][col];
for(int i=0;i<ls.size();i++)
fileData[i]=ls.get(i);
DefaultTableModel dm = new DefaultTableModel();
dm.setDataVector(fileData,tempHeader);
previewTable.setModel(dm);
} catch(IOException e){}
this is working on my machine. But the jar file which i send to my friend is not able to display the file.