1、打开intellij idea
2、这个程序编译没错,而运行这个程序居然报错了,其实就是开发和运行使用的jre版本不一致
3、点击file->setting
4、选择Build,Execution,Deployment
5、选择Compiler->Java Compiler
6、找到这个选项:Target bytecode version
7、点击下拉框,选择1.8版本,点击ok
8、再次运行程序,可以看到已经可以正常运行了
时间:2024-11-04 06:00:10
1、打开intellij idea
2、这个程序编译没错,而运行这个程序居然报错了,其实就是开发和运行使用的jre版本不一致
3、点击file->setting
4、选择Build,Execution,Deployment
5、选择Compiler->Java Compiler
6、找到这个选项:Target bytecode version
7、点击下拉框,选择1.8版本,点击ok
8、再次运行程序,可以看到已经可以正常运行了