使用Java 8 SDK为Java 7 JRE进行IntelliJ编译 [英] IntelliJ compile for Java 7 JRE using Java 8 SDK

查看:135
本文介绍了使用Java 8 SDK为Java 7 JRE进行IntelliJ编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有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.

我也在SO上看到了这个问题:"

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆