You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Todd Patrick <To...@dtn.com> on 2008/01/11 17:06:43 UTC

How do I specify the compiler on the cmd line?

I have a simple target:

<target name="all" depends="init">
	<javac srcdir="${src}"
			 destdir="${build}"
			 executable="/usr/jdk1.5.0_06/bin/javac"
			 compiler="javac1.5">
		<classpath>
		<pathelement
location="/lib/opencsv-1.3/deploy/opencsv-1.3.jar"/>
		</classpath>
	</javac>
</target>


In which I specify to use JDK 5 in the Javac Task.

How do I specify the compiler on the cmd line and remove the following
lines from the Javac Task:

executable="/usr/jdk1.5.0_06/bin/javac"
compiler="javac1.5"


Thanks,

--Todd

-----------------------------------------
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact
the sender by reply email and destroy all copies of the original
message.

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


RE: How do I specify the compiler on the cmd line?

Posted by Todd Patrick <To...@dtn.com>.
Thank you David.

That worked great!

--Todd 

-----Original Message-----
From: David Weintraub [mailto:qazwart@gmail.com] 
Sent: Friday, January 11, 2008 10:58 AM
To: Ant Users List
Subject: Re: How do I specify the compiler on the cmd line?

Define your build.xml like this. Use properties to define the
"executabe" and "compiler" parameters. You can then override these
values via the "-D" flag on the command line. If you don't specify any
overriding properties with the -D flag, it'll take the value in the
build.xml file.

<property name="executable"
    value="/usr/jdk1.5.0_06/bin/javac"/>

<property name="compiler"
    value="javac1.5"/>

<target name="all" depends="init">
         <javac srcdir="${src}"
                         destdir="${build}"
                         executable="${executable}"
                         compiler="${compiler}">
                <classpath>
                <pathelement
location="/lib/opencsv-1.3/deploy/opencsv-1.3.jar"/>
                </classpath>
        </javac>
</target>

On Jan 11, 2008 11:06 AM, Todd Patrick <To...@dtn.com> wrote:
> I have a simple target:
>
> <target name="all" depends="init">
>         <javac srcdir="${src}"
>                          destdir="${build}"
>                          executable="/usr/jdk1.5.0_06/bin/javac"
>                          compiler="javac1.5">
>                 <classpath>
>                 <pathelement
> location="/lib/opencsv-1.3/deploy/opencsv-1.3.jar"/>
>                 </classpath>
>         </javac>
> </target>
>
>
> In which I specify to use JDK 5 in the Javac Task.
>
> How do I specify the compiler on the cmd line and remove the following

> lines from the Javac Task:
>
> executable="/usr/jdk1.5.0_06/bin/javac"
> compiler="javac1.5"
>
>
> Thanks,
>
> --Todd
>
> -----------------------------------------
> NOTICE: This email message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged information. 
> Any unauthorized use, disclosure or distribution is prohibited. If you

> are not the intended recipient, please contact the sender by reply 
> email and destroy all copies of the original message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional

> commands, e-mail: user-help@ant.apache.org
>
>



--
--
David Weintraub
qazwart@gmail.com

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


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


Re: How do I specify the compiler on the cmd line?

Posted by David Weintraub <qa...@gmail.com>.
Define your build.xml like this. Use properties to define the
"executabe" and "compiler" parameters. You can then override these
values via the "-D" flag on the command line. If you don't specify any
overriding properties with the -D flag, it'll take the value in the
build.xml file.

<property name="executable"
    value="/usr/jdk1.5.0_06/bin/javac"/>

<property name="compiler"
    value="javac1.5"/>

<target name="all" depends="init">
         <javac srcdir="${src}"
                         destdir="${build}"
                         executable="${executable}"
                         compiler="${compiler}">
                <classpath>
                <pathelement
location="/lib/opencsv-1.3/deploy/opencsv-1.3.jar"/>
                </classpath>
        </javac>
</target>

On Jan 11, 2008 11:06 AM, Todd Patrick <To...@dtn.com> wrote:
> I have a simple target:
>
> <target name="all" depends="init">
>         <javac srcdir="${src}"
>                          destdir="${build}"
>                          executable="/usr/jdk1.5.0_06/bin/javac"
>                          compiler="javac1.5">
>                 <classpath>
>                 <pathelement
> location="/lib/opencsv-1.3/deploy/opencsv-1.3.jar"/>
>                 </classpath>
>         </javac>
> </target>
>
>
> In which I specify to use JDK 5 in the Javac Task.
>
> How do I specify the compiler on the cmd line and remove the following
> lines from the Javac Task:
>
> executable="/usr/jdk1.5.0_06/bin/javac"
> compiler="javac1.5"
>
>
> Thanks,
>
> --Todd
>
> -----------------------------------------
> NOTICE: This email message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged
> information. Any unauthorized use, disclosure or distribution is
> prohibited. If you are not the intended recipient, please contact
> the sender by reply email and destroy all copies of the original
> message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



-- 
--
David Weintraub
qazwart@gmail.com

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