It is because the version of javac used for compilation is inconsistent with the version of java used for running, resulting in an error. When IDEA is compiled, the default jdk is built-in, and the jdk in CMD is configured according to the path, and the two versions are different. Need to modify the compilation suite in idea.
ctrl+shift+alt+s
, open the project settings, modify the JDK and SDK used by the project
Recompile the jar after modification and it can run normally