我与 Intellij 合作开发了一个 java spring 项目
当我构建并运行项目时,出现这些错误:
cannot resolve symbol 'springframework'
Error:(32, 48) java: diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator)
Error:(33, 55) java: method references are not supported in -source 1.5 (use -source 8 or higher to enable method references)
我搜索过类似的问题,但没有与我合作
我已经尝试过:
使缓存无效并重新导入到 Maven 依赖项,但仍然给出错误
我的java版本:javac 1.8.0_111
maven错误:
并将错误日志文件上传到drive
最佳答案
可能是 Maven 的问题。在 pom.xml 中更新或添加 maven-compiler-plugin 插件。
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>//version_number</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build
关于java spring项目没有读取所有依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57637104/