我无法在intellij中成功导入okhttp项目。
https://github.com/square/okhttp
我使用的是intellij社区版:2016.1 Maven:3.0
当我点击 make 时。它显示“okhttp-tests”模块的以下错误消息:
Error:(94, 49) java: diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
所有子模块的语言级别自动设置为 5,而父模块的语言级别设置为 7。 当我将 okhttp-tests 模块的语言级别更改为 7 并进行热制作时,想法向我显示了以下错误消息:
错误:java:javacTask:源版本 1.7 需要目标版本 1.7
我使用的idea/maven版本是否错误? 请帮忙。
此外,git 存储库上没有可用于导入项目/设置开发环境的详细文档。 我想请求 okhttp 成员为像我这样的初学者创建一个描述性的 Contributors.md 文件。
最佳答案
如果JAVA_HOME设置正确,请同时检查Project Parent POM文件中maven-compiler-plugin的编译器版本
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
关于java - 无法使用 maven 插件在 intellij 中导入 okhttp 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37877867/