问题描述
我有相反的问题,因为:我使用Eclipse 3.7 .1 可以的支持JDK 1.7,但现在我开发JDK 1.6 ... ...这一直工作正常,但突然我得到这样的错误吨,当我做一个Ant构建(见下文)。
I have the opposite problem as Upgrade Eclipse java compiler: I'm using Eclipse 3.7.1 that can support JDK 1.7, but right now I am developing for JDK 1.6... which has been working fine, but suddenly I'm getting tons of errors like this when I do an ant build (see below).
我要使用JDK 1.6;我在哪里设置? Eclipse是正确设置(每个项目点JRE系统库[jdk1.6.0_16] Java构建路径),但蚂蚁似乎被忽视了。
I want to use JDK 1.6; where do I set that? Eclipse is set properly (Java Build Path for each project points to JRE System Library [jdk1.6.0_16]), but ant seems to be disregarding it.
[javac] warning: java\nio\ByteBuffer.class(java\nio:ByteBuffer.class): major version 51 is newer than 50, the highest major version supported by this compiler.
[javac] It is recommended that the compiler be upgraded.
[javac] warning: java\lang\Object.class(java\lang:Object.class): major version 51 is newer than 50, the highest major version supported by this compiler.
[javac] It is recommended that the compiler be upgraded.
[javac] warning: java\util\Collections.class(java\util:Collections.class): major version 51 is newer than 50, the highest major version supported by this compiler.
[javac] It is recommended that the compiler be upgraded.
[javac] warning: java\util\EnumMap.class(java\util:EnumMap.class): major version 51 is newer than 50, the highest major version supported by this compiler.
[javac] It is recommended that the compiler be upgraded.
更新:更多的线索 - 这是我第一次在建,从previous工作区导入项目单独Eclipse工作区这个特定的项目。我切换回旧的工作区,并建在同一个项目,它建立的罚款。
update: More clues -- this is the first time I've built this particular project in a separate Eclipse workspace that imports the project from a previous workspace. I switched back to the old workspace and built the same project and it builds fine.
的差异似乎是在我的新工作区在1.7 JRE蚂蚁运行,但在1.6 JRE在我的旧的工作区蚂蚁运行。是什么赋予了?我在哪里设置这个?我似乎无法找出哪些设置是不同的。
The difference seems to be that ant runs in a 1.7 JRE in my new workspace, but ant runs in a 1.6 JRE in my old workspace. What gives? Where do I set this? I can't seem to figure out which setting is different.
推荐答案
发现:
在Eclipse中的Ant的标签,如果你在你的构建单击鼠标右键,然后单击运行方式 - > Ant构建...,然后会弹出一个编辑配置对话框,您可以选择JRE要使用为Ant。
In the Ant tab in Eclipse, if you right-click on your build, and click Run As -> Ant Build..., then it will pop up an "Edit Configuration" dialog box, and you can select which JRE you want to use for Ant.
我不知道这个设置存储,但它似乎要被存储在工作区中,而不是与项目设置。
I don't know where this setting is stored, but it appears to be stored in the workspace rather than with the project settings.
这篇关于降级Eclipse的蚂蚁,而使用旧的JDK库编译(Java的1.7 - > 1.6)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!