【问题标题】:the import java.time cannot be resolved [duplicate]无法解析导入 java.time [重复]
【发布时间】:2016-04-07 08:49:30
【问题描述】:

您好,我正在使用 eclipse Mars,并且生成了以下消息错误:

Caused by: java.lang.Error: Unresolved compilation problems
The import java.time cannot be resolved
LocalDateTime cannot be resolved to a type
LocalDateTime cannot be resolved

我只是想解决我认为我应该使用JDK 8但我不知道在eclipse中使用它的问题。

【问题讨论】:

  • 您需要将 Eclipse 的 java 编译器级别设置为 1.8。进入首选项、java、编译器,你会看到那里的设置。
  • 我已经完成了这个问题,问题是我的库 java.time 中没有 LocalDateTime

标签: java


【解决方案1】:

确保选中并清理 Build automatically。如果它不起作用,请重新启动 Eclipse 并再次执行。

【讨论】:

    猜你喜欢
    • 2011-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-05
    • 1970-01-01
    • 2016-03-18
    • 2014-04-30
    相关资源
    最近更新 更多