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: | Can't compile using JDK 1.3 and Ant 1.6.3 when running JDK 1.5 | ||
---|---|---|---|
Product: | java | Reporter: | petervc <petervc> |
Component: | Project | Assignee: | Tomas Zezula <tzezula> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | Keywords: | REGRESSION, SIMPLEFIX |
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://issues.apache.org/bugzilla/show_bug.cgi?id=35437 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 58419 |
Description
petervc
2005-06-17 18:53:31 UTC
Opps. This has been reported in 57766. Gah. That was for NB4.1. Seems to have resurfaced in 4.2 Caused by Ant 1.6.3 upgrade. j2seproject's -init-macrodef-javac currently has <xsl:if test ="not(/p:project/p:configuration/j2seproject2:data/j2seproject2:explicit-platform/@explicit-source-supported ='false')"> <xsl:attribute name="source">${javac.source}</xsl:attribute> </xsl:if> <xsl:attribute name="target">${javac.target}</xsl:attribute> which should probably be <xsl:if test ="not(/p:project/p:configuration/j2seproject2:data/j2seproject2:explicit-platform/@explicit-source-supported ='false')"> <xsl:attribute name="source">${javac.source}</xsl:attribute> <xsl:attribute name="target">${javac.target}</xsl:attribute> </xsl:if> since Ant 1.6.3 will apparently add -source for you automatically if you have specified only -target, but javac then rejects this. I will file an Ant bug (see URL), but j2seproject will still need to use this workaround, I guess. Workaround is to override -init-macrodef-javac in build.xml to not include the 'target' attr. Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl,v <-- build-impl.xsl new revision: 1.56; previous revision: 1.55 done Tomas please read http://issues.apache.org/bugzilla/show_bug.cgi?id=35437#c1 and verify that your fix is correct. Can we add the 'compiler' attribute reliably? Do we need to? It may be possible to add the compiler="javac1.3" attribute to javac task in case of the JDK 1.3. The question is if we should reuse the "explicit-source-supported" attribute from the project.xml schema for this or if we should change the schema. The schema change will require the update of project.xml. The current fix should work, but the compiler="javac1.3" is nicer, I would try to change the build-iml.xsl to generate it. I will reuse the "explicit-source-supported" attribute for it. The reuse may not cause problems on the standard JDK compilesr which we are supporting (1.3+). I think use of compiler="javac1.x" would be correct for *any* version of the JDK, regardless of explicit-source-supported. But it would need to be bound to the actual target platform version (not the source level). And it would be incorrect for non-Sun platforms. Can we use the platforms.*.compiler definition from build.properties? At least that could be manually edited for people using other compilers like Jikes (rather than setting ${build.compiler} in project.properties), and j2seplatform could try to define it correctly for non-Sun JDKs that we know about, if they don't use the same tools.jar. |