【问题标题】:I couldn't build Jhipster sample app我无法构建 Jhipster 示例应用程序
【发布时间】:2015-04-27 10:17:09
【问题描述】:

我正在尝试在我的 Eclipse kepler 中运行 Jhipster 示例应用程序。我已经从 here 下载了该项目,并将其作为现有的 maven 项目导入,但无法构建。我得到了这个例外:

无法解析类型 java.util.Optional。它是从所需的 .class 文件 AccountResource.java 中间接引用的

还有很多“未定义的CSS文件”错误

如何在我的 Eclipse 中运行这个项目?

【问题讨论】:

  • java.util.Optional 在 Java 8 中,您在使用 Java 8 吗?

标签: eclipse maven jhipster


【解决方案1】:

通常您应该使用yeoman generator 创建您的应用程序。安装 yeoman 并从命令行执行 yo jhipster。

【讨论】:

    【解决方案2】:

    a)对于 java 异常,基本上您需要从构建路径中删除旧版本的 java 并添加对 java 8 的支持。

    您需要按照以下步骤操作

    1) Right-click on project » Properties » Java Build Path
    2) Select Libraries tab 
    3) Find the JRE System Library and remove it 
    4) Click Add Library... button at right side » Add the JRE System Library(Workspace default JRE)
    

    不要忘记将 Java jdk 编译器合规级别设置为 1.8 (Preference -> Java -> compiler)

    b) jhipster 网站提到了 eclipse 的配置设置(css、javascript 和 html 等)以避免 eclipe 中的错误。 https://jhipster.github.io/configuring_ide_eclipse.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-19
      • 2018-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多