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 60218 - Can't compile using JDK 1.3 and Ant 1.6.3 when running JDK 1.5
Summary: Can't compile using JDK 1.3 and Ant 1.6.3 when running JDK 1.5
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Zezula
URL: http://issues.apache.org/bugzilla/sho...
Keywords: REGRESSION, SIMPLEFIX
Depends on:
Blocks: 58419
  Show dependency tree
 
Reported: 2005-06-17 18:53 UTC by petervc
Modified: 2005-09-05 10:01 UTC (History)
0 users

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 petervc 2005-06-17 18:53:31 UTC
1. Add JDK1.3 through the platform manager.
2. Create a test project and change its platform to said JDK.
3. Build the project.  See the output window.
Comment 1 petervc 2005-06-17 19:00:29 UTC
Opps.  This has been reported in 57766.
Comment 2 petervc 2005-06-17 19:01:36 UTC
Gah.  That was for NB4.1.  Seems to have resurfaced in 4.2
Comment 3 Jesse Glick 2005-06-20 21:05:18 UTC
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.
Comment 4 Jesse Glick 2005-06-20 21:07:09 UTC
Workaround is to override -init-macrodef-javac in build.xml to not include the
'target' attr.
Comment 5 Tomas Zezula 2005-06-21 15:00:31 UTC
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
Comment 6 Jesse Glick 2005-06-21 16:50:54 UTC
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?
Comment 7 Tomas Zezula 2005-06-21 17:56:03 UTC
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+).
Comment 8 Jesse Glick 2005-06-22 22:16:14 UTC
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.