我正在运行我的Springboot应用程序并因文件夹格式而面临以下问题
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication at com.io.springbootstarter.CourseApiApp.main(CourseApiApp.java:17) Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
这是我的主要课程,
/**
* created by KishorKumarRavi on 17-Mar-2018 at 12:58:40 PM
*/
package com.io.springbootstarter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class CourseApiApp {
public static void main(String[] args) {
SpringApplication.run(CourseApiApp.class, args);
}
}
//更新: 上述问题是文件夹结构不正确。所有包都需要添加到在项目设置期间创建的Application.java文件中。