The type org.springframework.context.ConfigurableApplicationContext cannot be resolved.

The type org.springframework.context.ConfigurableApplicationContext cannot be resolved.eclipse导入maven的spring boot项目时,DemoApplication.java出现的错误。

解决方法: 
1,在命令行中转到项目目录。 
确保您的POM.xml与您的命令行在同一个目录中 
运行命令 mvn dependency:purge-local-repository 
如果您收到构建成功的消息,表示错误已解决。

2,删除本地资源库repository / org / springframework)文件夹并运行 mvn package。

若出现No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?错误。 
请参考http://blog.csdn.net/qq_22860341/article/details/78924354即可解决。