在运行项目时,出现如下错误
Exception in thread "main" java.lang.UnsupportedClassVersionError: shapes/MyPic has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
查看错误信息,原来是因为编译环境的改变造成的
解决办法:
将项目的编译环境设置成当前的JDK版本即可
步骤:
1. 右键项目—>Properties—> java Compiler–>Compiler Compliance level
2. 选择自己安装的当前的JDK环境即可