Ada*_*rto 5 java noclassdeffounderror mule zoneddatetime
我一直在尝试解决这个问题,但没有运气,希望有人能帮助我......
我创建了一个 DateUtil.java 类,该类放置在我的项目中: src/main/java/util/DateUtil.java
我使用调用组件调用“convertTime”方法,在本地笔记本电脑上一切正常,但当部署到本地服务器时,我在日志中收到以下错误
根异常堆栈跟踪:
java.lang.NoClassDefFoundError: Could not initialize class java.time.zone.ZoneRulesProvider
at java.time.ZoneRegion.ofId(Unknown Source)
at java.time.ZoneId.of(Unknown Source)
at java.time.ZoneId.of(Unknown Source)
at util.DateUtil.convertTime(DateUtil.java:25)
Run Code Online (Sandbox Code Playgroud)
DateUtil.class 使用以下 Java 类
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助 :)
正如您在评论中指出的,您正在使用jre.1.8.0_131. 请尝试使用 JDK 本身(而不是 JRE)。