报错信息:

java: 错误: 无效的源发行版:17
Dependency analysis found 0 affected files
Errors occurred while compiling module ‘open-ai’
javac 11 was used to compile java sources
Finished, saving caches…

① 检查当前 JDK 版本

java -version
javac -version

② 在 IDE 中切换 JDK
File > Project Structure > Modules > Dependencies

  • Projecr、Modules、SDKs都要选择jdk17

ps: 错误找半天才找到,很隐蔽。
在这里插入图片描述

③ 文件 > Java Compiler

Project bytecode version 选择 17

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐