我正在开发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 Platform = JDK 1.7。而在其中一个模块的属性中,我设置了Source level = 1.7。
EDIT2
> Mac OS 10.7.3
> NetBeans IDE 7.1(Build 201112071828)
> openjdk版本“1.7.0-internal”
> OpenJDK运行时环境(build 1.7.0-internal-uko_2012_02_15_11_51-b00)
> OpenJDK 64位服务器虚拟机(构建23.0-b15,混合模式)
suite.xml(184是这里的第二行)
common.xml(206是这里的第二行)
deprecation="${build.compiler.deprecation}" optimize="${build.compiler.optimize}" source="${javac.source}" target="${javac.target}" includeantruntime="false">