diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/FileIndexLocation.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/FileIndexLocation.java index 67fc9ae..a475c9e 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/FileIndexLocation.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/FileIndexLocation.java @@ -38,7 +38,20 @@ } public boolean createNewFile() throws IOException { - return this.indexFile.createNewFile(); + + // ensure the directory that will hold the index file exists + boolean createdFile = false; + File indexDirectory = this.indexFile.getParentFile(); + if(indexDirectory != null) { + boolean parentDirExists = indexDirectory.exists(); + if(!parentDirExists) { + parentDirExists = indexDirectory.mkdirs(); + } + if(parentDirExists) { + createdFile = this.indexFile.createNewFile(); + } + } + return createdFile; } public boolean delete() {