ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 50578] New: Javac task failes when the "target" attribute is specified as 1.1.
Date Thu, 13 Jan 2011 03:02:35 GMT

           Summary: Javac task failes when the "target" attribute is
                    specified as 1.1.
           Product: Ant
           Version: 1.8.2
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks

With Ant 1.8.2, Javac task failes when the "target" attribute is specified as
1.1 and source
attribute is not specified.

Exsample of build.xml.
<?xml version="1.0"?>

<project default="compile">

  <target name="compile">
    <javac destdir = "classes" srcdir = "src" target = "1.1"/>


Running the build.xml. (Version of javac is 1.6.0_22.)
% ant
Buildfile: build.xml

    [javac] build.xml:6: warning: 'includeantruntime' was not set, defaulting
to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to classes
    [javac]           WARNING
    [javac] The -source switch defaults to 1.5 in JDK 1.5 and 1.6.
    [javac] If you specify -target 1.2 you now must also specify -source 1.1.
    [javac] Ant will implicitly add -source 1.1 for you.  Please change your
build file.
    [javac] javac: invalid source release: 1.1
    [javac] Usage: javac <options> <source files>
    [javac] use -help for a list of possible options

build.xml:6: Compile failed; see the compiler error output for details.

Please note that the target attribute value is shown as 1.2.

I investigated the problem:  in, 
setImplicitSourceSwitch method is in called as following.

    (assumeJava15() || assumeJava16()) ? "1.5 in JDK 1.5 and 1.6" : "1.7 in JDK

But, setImplicitSourceSwitch method is declared as following.

private void setImplicitSourceSwitch(
    String defaultDetails,
    Commandline cmd,
    String target,
    String source) 

Please note the orders of "target" and "source": the call above passes
parameters in wrong order.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message