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).
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.
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.
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.