【发布时间】:2020-10-10 11:25:41
【问题描述】:
我已经浏览了堆栈溢出的所有可用文章。但是我的问题没有解决。我有一个可以正常工作的 java 8,它在我的所有应用程序中都可以在 eclipse 中正常工作,而且我也尝试使用 cmd 运行。这意味着类路径,环境变量等,一切正常。现在我想创建一个 Spring Boot 项目,所以当我使用 Run As Java Application 和 Spring Boot App 运行一个 Spring Boot 项目时,它会给出这个错误“错误:找不到或加载主类 package.classname”这是屏幕截图:
注意:我已经尝试了几乎所有的事情,比如清理项目、检查环境变量、更新 Eclipse 等。这个问题只存在于 Spring Boot 应用程序中。所有其他 Java 应用程序都可以正常工作。
这是我的 pom.xml 文件。
<?xml version="1.0" encoding="UTF-8"?>
4.0.0 org.springframework.boot spring-boot-starter-parent 2.3.1.发布 fyp fms 0.0.1-快照 车队管理系统 Spring Boot 上的车队管理系统。最后一年的项目。
<properties>
<java.version>1.8</java.version>
<start-class>fyp.fms.FleetManagementSystemApplication</start-class>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>
【问题讨论】:
标签: java spring-boot error-handling runtime-error runtimeexception