IDEA运行java文件 提示有非法字符

问题遇到的现象和发生背景

在IDEA中运行写好的java文件提示:
java: 非法字符: '\ufeff'
java: 需要 class、interface、enum 或 record

我的解答思路和尝试过的方法

在file encoding z中设置为utf-8无效
idea64.exe.vmoptions文件里添加-Dfile.encoding = utf-8 无效
将JDK版本改为17版 依然无效

我想要达到的结果

求帮助

传送门:https://blog.csdn.net/u010511598/article/details/104646011/ 图文解释很清楚了