简介
1、程序jdk从1.8升级为21
2、spring-boot升级为3.2.12
3、程序启动时出现红字提示信息
异常信息
ANTLR Tool version 4.9.2 used for code generation does not match the current runtime version 4.7.2ANTLR Runtime version 4.9.2 used for parser compilation does not match the current runtime version 4.7.2ANTLR Tool version 4.9.2 used for code generation does not match the current runtime version 4.7.2ANTLR Runtime version 4.9.2 used for parser compilation does not match the current runtime version 4.7.2ANTLR Tool version 4.9.2 used for code generation does not match the current runtime version 4.7.2ANTLR Runtime version 4.9.2 used for parser compilation does not match the current runtime version 4.7.2ANTLR Tool version 4.9.2 used for code generation does not match the current runtime version 4.7.2ANTLR Runtime version 4.9.2 used for parser compilation does not match the current runtime version 4.7.2ANTLR Tool version 4.9.2 used for code generation does not match the current runtime version 4.7.2ANTLR Runtime version 4.9.2 used for parser compilation does not match the current runtime version 4.7.2ANTLR Tool version 4.9.2 used for code generation does not match the current runtime version 4.7.2ANTLR Runtime version 4.9.2 used for parser compilation does not match the current runtime version 4.7.2
原因
从提示信息可以看出,是antlr4-runtime的依赖版本与当前程序不兼容
当前程序使用的版本是4.7.2
<!-- 使用最新的兼容版本 -->
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7.2</version>
</dependency>
解决
<!-- 使用最新的兼容版本 -->
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.9.2</version>
</dependency>