我进入Java7的发展和我已经添加JDK7到Java平台 ,并在项目属性中选择了它。
但是,当我编译时,我得到的消息,如:
warning: java/lang/Boolean.class(java/lang:Boolean.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
和
javac: invalid target release: 1.7
/Applications/NetBeans/NetBeans 7.1.app/Contents/Resources/NetBeans/harness/suite.xml:184: The following error occurred while executing this line:
/Applications/NetBeans/NetBeans 7.1.app/Contents/Resources/NetBeans/harness/common.xml:206: Compile failed; see the compiler error output for details.
所以据我了解NetBeans是使用javac 1.6。 我怎样才能更改为1.7?
编辑:
我正在写一个NetBeans平台的应用程序,并在主应用程序属性我设置:Java平台 = JDK 1.7。 而在模块的属性之一,我将源代码级别 = 1.7。
EDIT2
- 的Mac OS 10.7.3
- NetBeans IDE的 7.1(构建201112071828)
- OpenJDK的版本“1.7.0内部”
- OpenJDK的运行时环境(建立1.7.0-内部uko_2012_02_15_11_51-B00)
- OpenJDK的 64位服务器VM(构建23.0-B15,混合模式)
suite.xml(184是第二行这里)
<target name="build" depends="-init,branding,release,-hide-excluded-modules" description="Build all modules in the suite.">
<subant target="netbeans" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false">
<property name="cluster.path.evaluated" value="${cluster.path.evaluated}"/> <!-- Just for speed of pre-7.0 projects -->
</subant>
</target>
common.xml(206是第二行这里)
<nb-javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="${build.compiler.debug}" debuglevel="${build.compiler.debuglevel}" encoding="UTF-8"
deprecation="${build.compiler.deprecation}" optimize="${build.compiler.optimize}" source="${javac.source}" target="${javac.target}" includeantruntime="false">
<classpath refid="cp"/>
<compilerarg line="${javac.compilerargs}"/>
<processorpath refid="processor.cp"/>
</nb-javac>