错误原因是 编译jdk版本和main方法运行jdk版本不一致
错误如下:
java.lang.UnsupportedClassVersionError: com/test/Test has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
直接根据下图设置main方法运行的sdk即可 (版本根据你自己的版本进行调节)
image.png