2017-08-03 145 views
0

我一直在试图解决没有运气这个问题,希望有人可以帮助我......骡子 - NoClassDefFoundError的:无法初始化类java.time.zone.ZoneRulesProvider

我创建了一个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) 

DateUtil.class使用下面的Java类

import java.time.LocalDateTime; 
import java.time.ZoneId; 
import java.time.ZonedDateTime; 
import java.time.format.DateTimeFormatter; 

在此先感谢您的帮助:)

+0

'java.time'是可用于Java> = 8,这么一个愚蠢的问题:你使用的是什么版本? – 2017-08-03 19:40:12

+0

jre1.8.0_131在本地服务器和本地,感谢您的帮助。 – Adalberto

+1

不知道它是否会有所作为,但请尝试使用JDK,而不是JRE。 –

回答

0

正如你提到的意见,你正在使用jre.1.8.0_131。请尝试使用JDK本身(而不是JRE)。

JDK 1.8 Downloads.

相关问题