这是我的主要应用程序代码:
package u.d.dip.rs.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@EnableWebSecurity
@SpringBootApplication
@ComponentScan(basePackages = "u.d.dip")
@EnableAutoConfiguration
public class DipApplication {
public static void main(String[] args) {
SpringApplication.run(DipApplication.class, args);
}
}
我正在使用gradle来构建项目.即使正确导入SpringApplication文件,我也会收到以下错误:
Caused by: java.lang.classNotFoundException: org.springframework.boot.SpringApplication
at java.net.urlclassloader.findClass(urlclassloader.java:381)
at java.lang.classLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.classLoader.loadClass(ClassLoader.java:357)
... 6 more
Process finished with exit code 1
当我将鼠标悬停在SpringApplication上时,我正在收到gradle消息
[Gradle: org.springframework.boot:spring-boot:1.5.1.RELEASE] org.springframework.boot public class SpringApplication extends Object
任何帮助将非常感激.
提前致谢!
解决方法:
如果您使用的是IntelliJ Idea,则新版本2016.3.6解决了此问题.