今天在配置Spring Boot环境时,总是报错
Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.nativex.NativeListener
经过一顿查询,网上都是说是spring boot版本冲突问题,可是查询Spring Boot版本为2.6.2是最新的,而其余各版本也都是最新的。
最后找到是Spring Native的问题,我使用的Spring Native版本是0.11.1,而查询官方文档后得知该版本不支持jdk 1.8。
因此将Spring Native改为支持jdk 1.8的0.10.1即可顺利运行。