Trouble moving a .pde from Vista to OSX
in
Processing with Other Languages
•
2 years ago
I have a .pde that executes fine in on my Window PC. I've moved it to my OSX laptop and now I'm getting an unexpected NullPointerException.
Here's the PC version:
- void setup() {
- size(900, 700);
- File dir = new File("C:\\Users\\Lee\\Documents\\Processing\\bikeViz_alt\\data");
- String[] files = dir.list();
- println(files.length + " files present.");
- //Read all data from file in to one giant ArrayList (one for each type).
- ArrayList altTemp = new ArrayList();
- for(int i=0; i<files.length; i++){
- xml = new XMLElement(this, files[i]);
- GarminXML data = new GarminXML(xml);
- altTemp = data.getAltitudes();
- altitudes.addAll(altTemp);
- }
- println(files.length + " files read.");
- println(altitudes.size() + " data points.");
- }
And here's the OSX version (only thing different is the path):
- void setup() {
- size(900, 700);
- File dir = new File("Users/leecarmichael/Documents/Processing/bikeViz_alt/data");
- String[] files = dir.list();
- println(files.length + " files present.");
- //Read all data from file in to one giant ArrayList (one for each type).
- ArrayList altTemp = new ArrayList();
- for(int i=0; i<files.length; i++){
- xml = new XMLElement(this, files[i]);
- GarminXML data = new GarminXML(xml);
- altTemp = data.getAltitudes();
- altitudes.addAll(altTemp);
- }
- println(files.length + " files read.");
- println(altitudes.size() + " data points.");
- }
When I Run I get line 7 (println) highlighted yellow and the NullPointerException error. Any idea what's going on?
Thanks for your help!
Lee C
1