The scenario is:
I open a maven project, and it builds the project for me, and it works well. After wrongly deleting the .classpath file, I can never get it back. Restarting VSCode doesn't work either.
Version 1.24.0
Commit 6a6e02cef0f2122ee1469765b704faf5d0e0d859
Date 2018-06-06T17:35:40.560Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64
.classpath and .project are auto generated. .classpath and .project. .project has been re-generated, but .classpath cannot be re-generated.Missing .classpath file, the project fails to build.
File .classpath can be re-generated just as we first open the project.
The original issue is https://github.com/Microsoft/vscode-maven/issues/64
I can easily reproduced it and made a GIF, FYI:

@Eskibear do you want to contribute a fix to jdt.ls?
@fbricon ok, I can have a try.
For a maven project which has been opened before, it enters branch (1), thus the project is not added into toImport.
So even the .classpath is deleted, the project won't be re-imported, so the .classpath will not be re-generated.
for (MavenProjectInfo projectInfo : files) {
File pom = projectInfo.getPomFile();
IContainer container = root.getContainerForLocation(new Path(pom.getAbsolutePath()));
if (container == null) {
digestStore.updateDigest(pom.toPath());
toImport.add(projectInfo);
} else {
IProject project = container.getProject();
if (ProjectUtils.isMavenProject(project)) {
projects.add(container.getProject()); <----------(1)
} else if (project != null) {
//Project doesn't have the Maven nature, so we (re)import it
digestStore.updateDigest(pom.toPath());
// need to delete project due to m2e failing to create if linked and not the same name
project.delete(IProject.FORCE | IProject.NEVER_DELETE_PROJECT_CONTENT, subMonitor.split(5));
toImport.add(projectInfo);
}
}
}
if (!toImport.isEmpty()) {
ProjectImportConfiguration importConfig = new ProjectImportConfiguration();
configurationManager.importProjects(toImport, importConfig, subMonitor.split(75));
}
.classpath, so that we might be able to re-import the project when .classpath is missing.@fbricon
I have the same problem when i want to create a simple java project without build tools.
@CodingLegend27 If you're using the command "Java: Create Java Project" -> "No build tool" to create a simple Java project, then you don't need an explicit .classpath file. You can add extra libraries via user setting java.project.referencedLibraries.
I had some issues with debugging the java project.
So i thought first that it was an error due to the missing .classpath file.
But in the end i figured out that it was the vs code extension 'Java Language Support' by George Fraser, which always said that 'java.awt.*' cannot be imported.
TLDR: I uninstalled this extension and everything worked well again.
So no error due to missing .classpath file!
Most helpful comment
@fbricon ok, I can have a try.