I met a problem when I was trying to import a csv file into my java code, here is the related java code
try { File file = new File("/home/hanrui/workspace/table.csv");
BufferedReader reader = new BufferedReader(new FileReader(file));
reader.readLine();
String line = null;
while((line=reader.readLine())!=null){
String item[] = line.split(",");
String last = item[item.length-1];
int value = Integer.parseInt(last);
series1Numbers[row] = value;
series2Numbers[row] = value;
row++;
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
and when I debugged it, it reported an error: Source Not Found. But I imported the file like this: File file = new File(“/home/hanrui/workspace/table.csv”). (And I debugged other part of my codes with no error reported)
Any help will be appreciated =)
Here is the log:
[2012-06-05 15:27:25 – AndroidPlotExample] Installing AndroidPlotExample.apk…
[2012-06-05 15:27:52 – AndroidPlotExample] Success!
[2012-06-05 15:27:52 – AndroidPlotExample] Starting activity edu.ius.rwisman.AndroidPlotExample.AndroidPlotExampleActivity on device emulator-5554
[2012-06-05 15:27:53 – AndroidPlotExample] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=edu.ius.rwisman.AndroidPlotExample/.AndroidPlotExampleActivity }
[2012-06-05 15:27:54 – AndroidPlotExample] Attempting to connect debugger to ‘edu.ius.rwisman.AndroidPlotExample’ on port 8643
This problem is probably not related to the code but to some problem with your IDE. By the short error description it looks like the class doesn’t have the associated source code.
Edit:
Try to close Eclipse and check if there are any java ghost processes. If so kill them, restart Eclipse and try again