简体   繁体   English

Eclipse:构建并符合不同的 JRE 版本

[英]Eclipse: Build and conform to different JRE versions

Is there a way to build my app using one version of the JRE but have my source conform to another version?有没有办法使用一个版本的 JRE 构建我的应用程序,但让我的源代码符合另一个版本?

I would like to debug my app locally using 1.6 because OS X's 1.6 is much better than 1.4.2, but because of backwards compatibility reasons we actually ship using 1.4.2.我想使用 1.6 在本地调试我的应用程序,因为 OS X 的 1.6 比 1.4.2 好得多,但由于向后兼容的原因,我们实际上使用 1.4.2 发布。

You can manage this though the Run Configurations options.您可以通过运行配置选项来管理它。 Create a new Run Configuration --> Java Application and then you can specify the JRE you want to use for that configuration.创建一个新的运行配置 --> Java 应用程序,然后您可以指定要用于该配置的 JRE。

Or can change your Run configuration, but you can also change your project properties to do this too so any class you decide to run will do this.或者可以更改您的运行配置,但您也可以更改项目属性来执行此操作,因此您决定运行的任何 class 都会执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM