Jas*_*n S 9 java eclipse ant jdk1.6 java-7
我有与升级Eclipse java编译器相反的问题:我正在使用可以支持JDK 1.7的Eclipse 3.7.1 ,但是现在我正在为JDK 1.6开发...它一直工作正常,但突然间我得到了吨当我做一个蚂蚁构建时,这样的错误(见下文).
我想使用JDK 1.6; 我在哪里设置?Eclipse设置正确(每个项目的Java Build Path指向JRE系统库[jdk1.6.0_16]),但是ant似乎忽略了它.
[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.
Run Code Online (Sandbox Code Playgroud)
更新:更多线索 - 这是我第一次在单独的Eclipse工作区中构建此特定项目,该工作区从以前的工作区导入项目.我切换回旧工作区并构建了相同的项目,它构建得很好.
差异似乎是ant在我的新工作区中以1.7 JRE运行,但是ant在我的旧工作区中以1.6 JRE运行.是什么赋予了?我在哪里设置这个?我似乎无法弄清楚哪个设置不同.
Jas*_*n S 19
找到了:
在Eclipse的Ant选项卡中,如果右键单击您的构建,然后单击Run As - > Ant Build ...,它将弹出一个"Edit Configuration"对话框,您可以选择您想要的JRE用于Ant.
我不知道此设置的存储位置,但它似乎存储在工作区而不是项目设置中.