ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conelly, Luis (GNF, Contractor)" <>
Subject RE: compile attribute of JAVAC task
Date Fri, 26 Mar 2004 23:10:36 GMT
If you are using a compiler < 1.4 in <javac> task (as you mention), it will not recognize
the -source flag.
I suggest either to remove the "source" flag from your <javac> task or let ant to compile
your source files using JDK 1.4

-----Original Message-----
From: Sarsam, Vinitha [mailto:Vinitha.Sarsam@FMR.COM]
Sent: Friday, March 26, 2004 5:04 PM
Subject: compile attribute of JAVAC task

Hi All,


We are running ANT under 1.4 VM. But, compiling the code with javac 1.3. ( possible through
Javac task's executable attribute ).

We have also turned the "source" attribute of javac task. [mainly for Assert statement compatibility]


But, are running into compilation errors "javac: invalid flag: -source"

This behavior seems to run against Ant's own documentation of the "source" attribute to the
javac task.



Value of the -source command-line switch; will be ignored by all implementations prior to
javac1.4 (or modern when Ant is not running in a 1.3 VM) and jikes.
If you use this attribute together with jikes, you must make sure that your version of jikes
supports the -source switch.
Legal values are 1.3, 1.4 and 1.5 - by default, no -source argument will be used at all.


Any ideas how to get around the problem? All inputs appreciated.






    [javac] Since fork is true, ignoring compiler setting.

    [javac] Compiling 32 source files to /<XYZ>/classes

    [javac] Since fork is true, ignoring compiler setting.

    [javac] javac: invalid flag: -source

    [javac] Usage: javac <options> <source files>

    [javac] where possible options include:

    [javac]   -g                        Generate all debugging info

    [javac]   -g:none                   Generate no debugging info

    [javac]   -g:{lines,vars,source}    Generate only some debugging info

    [javac]   -O                        Optimize; may hinder debugging or enlarge class file

    [javac]   -nowarn                   Generate no warnings

    [javac]   -verbose                  Output messages about what the compiler is doing

    [javac]   -deprecation              Output source locations where deprecated APIs are

    [javac]   -classpath <path>         Specify where to find user class files

    [javac]   -sourcepath <path>        Specify where to find input source files

    [javac]   -bootclasspath <path>     Override location of bootstrap class files

    [javac]   -extdirs <dirs>           Override location of installed extensions

    [javac]   -d <directory>            Specify where to place generated class files

    [javac]   -encoding <encoding>      Specify character encoding used by source files

    [javac]   -target <release>         Generate class files for specific VM version


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message