You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by query <se...@rediffmail.com> on 2007/06/01 10:36:22 UTC

classpath issue in task

I have created classpath in a build file and using it in the same build file for compiling java source files.&nbsp;When I checked the log file I found that classfile destination folder(absolute path of class.dest) was also included in the 
classpath though I had not specified in eg.class.pathAs a result, it creating more class files.I suspect that this is due to that extra path in classpath.
Is there any way to exclude that classpath while compiling java source files?
Log file:
[javac] Using modern compiler&nbsp;&nbsp;&nbsp; [javac] Compilation arguments:&nbsp;&nbsp;&nbsp; [javac] \'-d\'&nbsp;&nbsp;&nbsp; [javac] \'E:\\samplebuild\\eg\\eg2\\classfiles\'&nbsp;&nbsp;&nbsp; [javac] \'-classpath\'&nbsp;&nbsp;&nbsp; [javac] \'E:\\samplebuild\\eg\\eg2\\classfiles;C:\\PROGRA~1\\jdk1.5;E:\\samplebuild\\eg\\eg1\\eg.jar\'&nbsp;&nbsp;&nbsp; [javac] \'-sourcepath\'&nbsp;&nbsp;&nbsp; [javac] \'E:\\samplebuild\\eg\\eg2\\sourcefiles\'&nbsp;&nbsp;&nbsp; [javac] \'-g:none\'&nbsp;&nbsp;&nbsp; [javac] &nbsp;&nbsp;&nbsp; [javac] The \' characters around the executable and arguments are&nbsp;&nbsp;&nbsp; [javac] not part of the command.&nbsp;&nbsp;&nbsp; [javac] Files to be compiled:
Build file:
&lt;javac srcdir=\"${src.dest}\" destdir=\"${class.dest}\" includeAntRuntime=\"no\"&gt;&nbsp;&lt;include name=\"*.java\"/&gt;&nbsp;&lt;classpath refid=\"eg.class.path\"/&gt;&lt;/javac&gt;

Re: classpath issue in task

Posted by David Weintraub <qa...@gmail.com>.
You didn't include a code snippet, so it is hard to see what you did.

There is a <classpath> nested element in the <javac> task where you
can specify a classpath either through a "fileset" or via a reference.
You can also use the "classpath=" parameter to specify the classpath.

However, if you do not specify either, it takes the value of classpath
via your environment.

How do you specify classpath? Can you print out the classpath right
before you call the <javac> task to verify that it is set the way you
want?

If you're setting claspath via reference, you can convert the
reference to a parameter and then print the parameter.

<parameter name="classpath.param" refid="classpath.ref"/>
<echo message="My classpath is &quot;${classpath.param}&quot;"/>
<javac ...>

On 1 Jun 2007 08:36:22 -0000, query <se...@rediffmail.com> wrote:
> I have created classpath in a build file and using it in the same build file for compiling java source files.&nbsp;When I checked the log file I found that classfile destination folder(absolute path of class.dest) was also included in the
> classpath though I had not specified in eg.class.pathAs a result, it creating more class files.I suspect that this is due to that extra path in classpath.
> Is there any way to exclude that classpath while compiling java source files?
> Log file:
> [javac] Using modern compiler&nbsp;&nbsp;&nbsp; [javac] Compilation arguments:&nbsp;&nbsp;&nbsp; [javac] \'-d\'&nbsp;&nbsp;&nbsp; [javac] \'E:\\samplebuild\\eg\\eg2\\classfiles\'&nbsp;&nbsp;&nbsp; [javac] \'-classpath\'&nbsp;&nbsp;&nbsp; [javac] \'E:\\samplebuild\\eg\\eg2\\classfiles;C:\\PROGRA~1\\jdk1.5;E:\\samplebuild\\eg\\eg1\\eg.jar\'&nbsp;&nbsp;&nbsp; [javac] \'-sourcepath\'&nbsp;&nbsp;&nbsp; [javac] \'E:\\samplebuild\\eg\\eg2\\sourcefiles\'&nbsp;&nbsp;&nbsp; [javac] \'-g:none\'&nbsp;&nbsp;&nbsp; [javac] &nbsp;&nbsp;&nbsp; [javac] The \' characters around the executable and arguments are&nbsp;&nbsp;&nbsp; [javac] not part of the command.&nbsp;&nbsp;&nbsp; [javac] Files to be compiled:
> Build file:
> &lt;javac srcdir=\"${src.dest}\" destdir=\"${class.dest}\" includeAntRuntime=\"no\"&gt;&nbsp;&lt;include name=\"*.java\"/&gt;&nbsp;&lt;classpath refid=\"eg.class.path\"/&gt;&lt;/javac&gt;


-- 
--
David Weintraub
qazwart@gmail.com

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