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.

Bug 203088 - "javac: invalid target release: 1.7" when trying clean/build on Mac with JDK 7 Developer Preview
Summary: "javac: invalid target release: 1.7" when trying clean/build on Mac with JDK ...
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 7.1
Hardware: PC Mac OS X
: P2 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-04 18:38 UTC by host
Modified: 2011-11-23 15:36 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description host 2011-10-04 18:38:40 UTC
I am using the latest NB daily on Mac running on 1.6.0_26 and I have added the JDK 7 Developer Preview for Mac as a platform. In the properties of my Web app project I have set source/binary format to JDK 7. Now when I try to clean/compile this project, I get the following error:

javac: invalid target release: 1.7
Usage: javac <options> <source files>
use -help for a list of possible options
/Users/holger/Development/ObTiMA/nbproject/build-impl.xml:580: The following error occurred while executing this line:
/Users/holger/Development/ObTiMA/nbproject/build-impl.xml:292: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 3 seconds)
Comment 1 host 2011-10-04 18:39:31 UTC
I forgot: I also set the platform of the project correctly to JDK 7.
Comment 2 Jan Lahoda 2011-10-06 16:12:33 UTC
Tomas, any idea what could be wrong? Thanks.
Comment 3 Tomas Zezula 2011-10-07 06:26:39 UTC
I will download the dev preview and try.
Comment 4 Tomas Zezula 2011-10-18 17:07:01 UTC
Works fine in J2SE project, Web project specific problem.
The problem is that fork="false" the JDK 7.0 params are passed to JDK 6.0 compiler. The executable requires fork="true".

On the line 293 of build-iml.xml the
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">

should become:

<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
Comment 5 David Konecny 2011-10-19 07:58:00 UTC
Thanks for the solution Tomas.
webmain #a274f88d445d
Comment 6 Quality Engineering 2011-10-24 14:07:43 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/a274f88d445d
User: David Konecny <dkonecny@netbeans.org>
Log: #203088 - "javac: invalid target release: 1.7" when trying clean/build on Mac with JDK 7 Developer Preview