运行Eclipse火星与Java 1.6 [英] Run Eclipse Mars with Java 1.6

查看:731
本文介绍了运行Eclipse火星与Java 1.6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载的Eclipse(火星)的最新版本,并在eclipse.ini文件修改所需的Java版本1.6为我的项目使用Java 1.6。

I downloaded the latest release of Eclipse (Mars) and changed the required Java version to 1.6 in eclipse.ini file as my project uses Java 1.6.

我配置安装的JRE使用Java 1.6。
但是,当我尝试执行我的Ant目标是创建一个错误 - JRE版本低于1.7,不支持

I configured installed JREs inside Eclipse to use Java 1.6. But when I try to execute my ant target it creates an error - "JRE version less than 1.7 is not supported".

有任何解决方法使用Java 1.6火星版本,我无法升级到Java 1.7的时刻??

Is there any workaround to use Java 1.6 in Mars version as I'm unable to upgrade to Java 1.7 at the moment ??

推荐答案

我升级到Eclipse的火星后所面临的同样的问题。

I faced the same problem after upgrading to Eclipse Mars.

我解决了这个由改变项目到JDK7的外部工具配置的运行时环境

我假设你知道如何JDK7在eclipse添加到您安装了JRE

打开外部工具配置...,然后更改为JRE 1.7 JDK

然后,更改JRE

但是,这将创建的另一个问题,编译后的罐子会在JDK 7,这将不会与JDK6生产服务器工作。

But this will create another problem, the compiled jar will be in JDK 7 and this will not work on production servers with JDK6.

要解决这个问题,根本的更改目标属性任务为1.6

To solve this, simply change the target attribute in the task to be 1.6

< javac的目标=1.6>

<javac target="1.6">

按从@dog和@克里斯建议,这里是更新蚂蚁javac任务。

As per suggested from @dog and @Chris, Here is updated ant javac task.

这篇关于运行Eclipse火星与Java 1.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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