[英]Error: Could not find or load main
i'm creating a SpringRoo Project in eclipse (STS), and run the project throw Error: Could not find or load main class src.main.java.com.ng.login.LogInApplication 我正在Eclipse(STS)中创建一个SpringRoo项目,并运行该项目引发错误: 无法找到或加载主类src.main.java.com.ng.login.LogInApplication
My project directory 我的项目目录
My Spring Roo Log File 我的Spring Roo日志文件
jpa setup --provider HIBERNATE --database MYSQL
entity jpa --class ~.domain.LogIn
field string --fieldName username --notNull --sizeMax 5
field string --fieldName password --notNull --sizeMax 5
repository jpa --entity ~.domain.LogIn --interface ~.respository.LogInRespository
service --entity ~.domain.LogIn --repository ~.respository.LogInRespository --interface ~.service.LogInService --class ~.service.impl.LogInServiceImpl
web mvc setup
web mvc view setup --type THYMELEAF
web mvc controller --controller ~.web.LoginController --entity ~.domain.LogIn --service ~.service.LogInService --responseType THYMELEAF
perform eclipse
Please Help me. 请帮我。 I'm newbie in Spring Roo.
我是Spring Roo的新手 。
It seems your project hasn't been loaded correctly by STS, as it is using the src folder as part of the java package: src.main.java.com.ng.login. 看来您的项目尚未通过STS正确加载,因为它使用src文件夹作为java包src.main.java.com.ng.login的一部分。 .
。
It would be interesting to know the Spring Roo version and the steps you have performed to generate the project and load it into the STS. 了解Spring Roo版本以及生成项目并将其加载到STS中执行的步骤将非常有趣。
Anyway, when the STS Spring Roo plugin is used the project is created and loaded in STS automatically as explained in the reference guide , so I suppose you have created the project using the text console instead and then have imported the project in STS. 无论如何,当使用STS Spring Roo插件时,将按照参考指南中的说明自动创建项目并将其加载到STS 中 ,因此我想您已经使用文本控制台创建了该项目,然后将其导入了STS中。
Also you have used the perform eclipse command, which is a way to call mvn eclipse:eclipse to generate the eclipse project. 另外,您还使用了perform eclipse命令,这是一种调用mvn eclipse:eclipse来生成eclipse项目的方法。 This command is deprecated, as nowadays the STS has support to load maven projects without using that utility.
不推荐使用此命令,因为如今STS支持在不使用该实用程序的情况下加载Maven项目。
If that's the case, try the following to solve the problem: 如果是这种情况,请尝试以下解决问题的方法:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.