使用Java 8 SDK为Java 7 JRE进行IntelliJ编译 [英] IntelliJ compile for Java 7 JRE using Java 8 SDK
问题描述
我有Java 8 SDK和运行时,还有一个仅使用Java 7功能的项目.我想知道是否可以设置intellij来构建Java-7级的jar,这在命令行中肯定可以实现吗?
I have the Java 8 SDK and runtime, and a project that is only using Java 7 features. I was wondering whether I could set up intellij to build a Java-7-level jar, something that is definitely possible from command line?
到目前为止,我已经尝试过将项目语言级别设置为7作为实验,但这显然是不够的,并不是我真正需要的.
So far, I have tried simply setting the project language level to 7 as an experiment, but that is obviously insufficient and not really what I need.
I have also seen this question on SO: "Intellij IDEA using java7 compiler to compile when I have configured it to use Java6", but my project SDK is already set up to the newest Java version, and I merely need a Java-7-compatible artifact/jar compilation.
我不幸的是,我的本地系统上只有Java 6和Java 8 JRE/SDK,因为不幸的是Java 7在我的系统上有问题并且不兼容.
I only have Java 6 and Java 8 JREs/SDKs on my local system because unfortunately Java 7 has issues on my system and is not compatible.
推荐答案
文件->设置->编译器-> Java编译器->项目字节码版本-> 1.7
File -> Settings -> Compiler -> Java Compiler -> Project bytecode version -> 1.7
这篇关于使用Java 8 SDK为Java 7 JRE进行IntelliJ编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!