You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Lim, Teck Hooi" <Te...@acs-inc.com> on 2005/12/20 12:14:35 UTC

source attribute

Hi,

 

I have used <javac> tag with the following attributes

 

        <javac destdir="${root.build.dir}"

               debug="${compile.debug}"

               deprecation="${compile.deprecation}"

               optimize="${compile.optimize}"

               fork="true"

               source="1.4" >

            <classpath refid="module.path" />

            ...

        </javac>

        

As you can see I try to compile 1.4 sources with "enum" as a variable name
and causes this

 

    [javac] d:\project\mybasic\src\com\acme\TestQueue.java:192: warning: as
of release 1.5, 'enum' is a keyword, and may not be used as an identifier

    [javac] (try -source 1.5 to use 'enum' as a keyword)

    [javac]                             Enumeration enum =
qb.getEnumeration();

    [javac]                                             ^

            ....

 

How do I remove this warning? I have used fork="true" and source="1.4", am I
missing anything else? My Ant version is 1.6.5. Please advise. TQ

 

/lim/


Re: source attribute

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 20 Dec 2005, Teck Hooi Lim <Te...@acs-inc.com> wrote:

>     [javac] d:\project\mybasic\src\com\acme\TestQueue.java:192:
>     warning: as of release 1.5, 'enum' is a keyword, and may not be
>     used as an identifier

This is a warning, without source="1.4" it would be an error.  That's
all the source attribute can do for you.  nowarn can be used to
disable warning on top of that.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: source attribute

Posted by Jeffrey E Care <ca...@us.ibm.com>.
Try source="1.4" as well as target="1.4"

-- 
Jeffrey E. Care (carej@us.ibm.com)
WebSphere v7 Release Engineer
WebSphere Build Tooling Lead (Project Mantis)


"Lim, Teck Hooi" <Te...@acs-inc.com> wrote on 12/20/2005 06:14:35 
AM:

> Hi,
> 
> 
> 
> I have used <javac> tag with the following attributes
> 
> 
> 
>         <javac destdir="${root.build.dir}"
> 
>                debug="${compile.debug}"
> 
>                deprecation="${compile.deprecation}"
> 
>                optimize="${compile.optimize}"
> 
>                fork="true"
> 
>                source="1.4" >
> 
>             <classpath refid="module.path" />
> 
>             ...
> 
>         </javac>
> 
> 
> 
> As you can see I try to compile 1.4 sources with "enum" as a variable 
name
> and causes this
> 
> 
> 
>     [javac] d:\project\mybasic\src\com\acme\TestQueue.java:192: warning: 
as
> of release 1.5, 'enum' is a keyword, and may not be used as an 
identifier
> 
>     [javac] (try -source 1.5 to use 'enum' as a keyword)
> 
>     [javac]                             Enumeration enum =
> qb.getEnumeration();
> 
>     [javac]                                             ^
> 
>             ....
> 
> 
> 
> How do I remove this warning? I have used fork="true" and source="1.4", 
am I
> missing anything else? My Ant version is 1.6.5. Please advise. TQ
> 
> 
> 
> /lim/
>