This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | "javac: invalid target release: 1.7" when building a java 7 source on Mac | ||
---|---|---|---|
Product: | apisupport | Reporter: | Uko |
Component: | Harness | Assignee: | Jesse Glick <jglick> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 209239 | ||
Bug Blocks: |
Description
Uko
2012-02-15 15:32:38 UTC
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 jdkhome="/path/to/jdk7" in /Applications/NetBeans/NetBeans\ 7.1.app/Contents/Resources/NetBeans/harness/etc/app.conf ? (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. > ...NetBeans/harness/etc/app.conf 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. core-main #630c26d3ebdb Integrated into 'main-golden', will be available in build *201202220400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/630c26d3ebdb User: Jesse Glick <jglick@netbeans.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. |