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