1、現象java
基於JAVA SpringBoot2.0.4的項目,發部後項目發部後,放到OpenJDK環境中運行時,提示下列錯誤:linux
2019-10-22 10:03:55 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultValidator' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.valueextraction.ValueExtractorManagerspring
可是使用OracleJDK是正常的。hibernate
如圖:3d
2、解決方案blog
一、解決方案一:it
(1)通過檢查,緣由是使用IDEA2019.2.3發部出來的文件中,包含一個jar:javafx.base-11.0.0-20180702.224858-3.jar、javafx.base-11.0.0-20180702.223831-2-linux.jar、javafx.base-11.0.0-20180702.224858-3-mac.jar 把這三個JAR刪除便可。io
(2)修改設置中的下列地方爲你所使用的jdk版本。class
二、 解決方案二:使用IDEA2018.1版本發部。jdk