eclipse - Gradle(包装器)+ STS + Spring Boot:错误:找不到或加载主类1.1,

标签 eclipse spring-boot gradle spring-tool-suite buildship

运行Gradle Tasks-> application-> bootRun时,许多项目中的一个开始给我以下错误:

Error: Could not find or load main class 1.1,



但是,以下两个工作:
  • 从命令行
  • 运行./gradlew bootRun
  • 使用STS启动服务Boot Dashboard

  • 奇怪的是Gradle Task窗口的执行过程是1.1,类。

    有想法吗?

    配置
  • Windows 10专业版
  • STS 3.9.4.RELEASE
  • Eclipse Buildship 2.2.1
  • Gradle包装器4.5.1
  • Spring Boot 2.0.3.RELEASE

  • 尝试
  • ./gradlew clean build
  • 窗口中刷新的Gradle Tasks
  • 右键单击项目并运行Gradle -> Refresh Gradle Project
  • 重新启动STS
  • 删除./metadata并重新启动STS
  • 删除的./bin./build目录
  • 卸载项目并重新导入为Gradle项目
  • 运行“STS -clean”

  • ...总是一样的结果

    最佳答案

    我有同样的问题。无论如何,在Eclipse Oxygen中,它突然停止工作,但是在终端中就可以了。

    https://github.com/JetBrains/kotlin-native/issues/1747

    也许此链接会有所帮助。它对我不起作用,但我相信它指出了正确的方向。

    他目的解决方案:

    No, removing of node does not help. But the follow line in the Gradle script solve the problem:

    System.getProperties().remove( 'org.osgi.framework.system.capabilities' )
    

    The value of the property is:

    osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0, 1.1, 1.2",osgi.ee; osgi.ee="JRE"; version:List<Version>="1.0, 1.1",osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8",osgi.ee; osgi.ee="JavaSE/compact1"; version:List<Version>="1.8",osgi.ee; osgi.ee="JavaSE/compact2"; version:List<Version>="1.8",osgi.ee; osgi.ee="JavaSE/compact3"; version:List<Version>="1.8"
    

    It look like that you try to add all environment variable to the command line but does not quote correctly.

    关于eclipse - Gradle(包装器)+ STS + Spring Boot:错误:找不到或加载主类1.1,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51290717/

    相关文章:

    mysql - Spring Data 似乎不理解@Column 名称

    java - swagger中spring fox health路由显示多个HTTP方法

    spring-mvc - 将 Spring Data Rest 重新配置为第 1 页的索引

    gradle - 找不到方法sonarProperties()

    java - 为什么compileJava实际上被跳过了?

    java - 错误 : More than one file was found with OS independent path 'META-INF/DEPENDENCIES'

    C 控制台游戏-Eclipse CDT 调试和发布是不同的

    Android VM 作为开发模拟器

    java - 如果元素出现,如何关闭?

    java - 如何在java中从单个字符串创建集合<String>?