I've added JDK7 into Java Platforms and have selected it in the project properties.
But when I'm building a progect, I get messages:
javac: invalid target release: 1.7
Usage: javac <options> <source files>
use -help for a list of possible options
/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.
Also I get warnings like:
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.
so it looks like a java 6 compiler is trying to compile 1.7 source
Api support specific.
The NBM Ant harness uses the toolset from the IDE's JDK, so if you want to use a newer language version you need to run the IDE on that JDK. Not sure if it is possible to use a forked javac using the current harness; org.netbeans.nbbuild.CustomJavac is used to handle annotations.
(In reply to comment #3)
> The NBM Ant harness uses the toolset from the IDE's JDK, so if you want to use
> a newer language version you need to run the IDE on that JDK. Not sure if it is
> possible to use a forked javac using the current harness;
> org.netbeans.nbbuild.CustomJavac is used to handle annotations.
My team mate on linux can successfully compile java 1.7 running NetBeans IDE on JDK6.
But if there is no other way, how should I run Netbeans on JDK7 on Mac?
Ok, I've successfully started NetBeans as:
netbeans --jdkhome /path/to/jdk7
and it works. But
1) I guess NetBeans should be able to compile java7 running under JDK6.
2) Why I Netbeans running under JDK6 when i put
(In reply to comment #5)
> I guess NetBeans should be able to compile java7 running under JDK6.
For other project types it can; there are some technical difficulties in the case of Ant-based NB module projects which I am looking into.
I guess you meant to use ...NetBeans/etc/netbeans.conf, the IDE's own configuration. harness/etc/app.conf is a template to be copied into a NB-Platform-based application.
Integrated into 'main-golden', will be available in build *201202220400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jesse Glick <firstname.lastname@example.org>
Log: #208464: use javac from selected platform.
Actually annoying when running IDE on JDK 7 and compiling with -source 6, since the JDK 7 compiler is better;
but necessary when running the IDE on JDK 6 and compiling with -source 7.