Thanks for the response.
Issue is resolved now.
I tried both the options
1. <exec program="javac">
<arg value="-classpath" />
<arg path="%CLASSPATH%" />
<arg file="${filename}" />
</exec>
works well. It doesn't give any error.
2. <exec program="cmd" commandline="javac -classpath %CLASSPATH% ..."
failonerror="false" />
when using this system hangs for infinite time. I'd to kill the
process.
Thanks
Shelly
-----Original Message-----
From: Gert Driesen [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 14, 2005 11:25 PM
To: 'Troy Laurin'; Shelly Midha
Cc: [email protected]
Subject: RE: [Nant-users] Error while compiling java file using javac in
NAnt script?
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Troy
> Laurin
> Sent: donderdag 14 juli 2005 11:59
> To: Shelly Midha
> Cc: [email protected]
> Subject: Re: [Nant-users] Error while compiling java file using javac
> in NAnt script?
>
> On 7/14/05, Shelly Midha <[EMAIL PROTECTED]> wrote:
> >
> >
> > I'm compiling a set of java files using the following
> command in NAnt file
> >
> > <exec program="javac" commandline = "-classpath
> %CLASSPATH% ${filename}"
> > failonerror = "false">
> > </exec>
>
> Shelly,
>
> The %CLASSPATH% environment variable is probably not being expanded -
> this is usually done by the command processor (cmd) but you are
> executing javac directly...
>
> If you are using NAnt 0.85, you can get the value of the environment
> variable using ${environment::get-variable('CLASSPATH')}, but you may
> need to wrap it in an existence check
> ${environment::variable-exists('CLASSPATH')}, and there may be issues
> with case sensitivity (!)...
> http://nant.sourceforge.net/release/latest/help/functions/#Environment
> for more details.
>
>
> Alternatively, run your exec through cmd.exe...
>
> <exec program="cmd" commandline="javac -classpath %CLASSPATH% ..."
> failonerror="false" />
If you're using NAnt 0.85, another solution would be this:
<exec program="javac">
<arg value="-classpath" />
<arg path="%CLASSPATH%" />
<arg file="${filename}" />
</exec>
Gert
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Nant-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users