diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index f0c5fa113..51b4396ff 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -620,6 +620,17 @@ public class BaseNoGui { loadContributedHardware(indexer); librariesIndexer = new LibrariesIndexer(BaseNoGui.getSettingsFolder()); + File librariesIndexFile = librariesIndexer.getIndexFile(); + if (!librariesIndexFile.isFile()) { + try { + // Otherwise create an empty packages index + FileOutputStream out = new FileOutputStream(librariesIndexFile); + out.write("{ \"libraries\" : [ ] }".getBytes()); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } librariesIndexer.parseIndex(); }