I you want to some additional classpath In your javac reference then you can use Step1: first make the classpath reference <path id="build.classpath"> <pathelement location="${lib.dir}/your_class1.jar"/> <pathelement location="${lib.dir}/your_class2.jar"/> <pathelement location="${lib.dir}/your_class3.jar"/> </path Then use it with javac reference <target name="compile"> <javac srcdir="your_src_dir" destdir="your_dest_dir_for_classes" classpathref="build.classpath" /> </target> Mail me if this works.... Regards Saurabh
-----Original Message----- From: query [mailto:[EMAIL PROTECTED] Sent: Friday, June 01, 2007 6:08 PM To: user@ant.apache.org Subject: Re :Re: classpath issue in <javac> task Below is the sample log file and build fileLog file: [javac] Using modern compiler [javac] Compilation arguments: [javac] \'-d\' [javac] \'E:\\samplebuild\\eg\\eg2\\classfiles\' [javac] \'-classpath\' [javac] \'E:\\samplebuild\\eg\\eg2\\classfiles;C:\\PROGRA~1\\jdk1.5;E:\\samplebuild\ \eg\\eg1\\eg.jar\' [javac] \'-sourcepath\' [javac] \'E:\\samplebuild\\eg\\eg2\\sourcefiles\' [javac] \'-g:none\' [javac] [javac] The \' characters around the executable and arguments are [javac] not part of the command. [javac] Files to be compiled:Build file: <javac srcdir=\"${src.dest}\" destdir=\"${class.dest}\" includeAntRuntime=\"no\"> <include name=\"*.java\"/> <classpath refid=\"eg.class.path\"/></javac>On Fri, 1 Jun 2007 06:55:22 -0400 \"Ant Users List\" wroteYou didn\'t include a code snippet, so it is hard to see what you did.There is a nested element in the task where youcan 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 classpathvia your environment.How do you specify classpath? Can you print out the classpath rightbefore you call the task to verify that it is set the way youwant?If you\'re setting claspath via reference, you can convert thereference to a parameter and then print the parameter.On 1 Jun 2007 08:36:22 -0000, query wrote:> I have created classpath in a build file and using it in the same build file for compiling java so urce files. 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 [javac] Compilation arguments: [javac] \'-d\' [javac] \'E:\\samplebuild\\eg\\eg2\\classfiles\' [javac] \'-classpath\' [javac] \'E:\\samplebuild\\eg\\eg2\\classfiles;C:\\PROGRA~1\\jdk1.5;E:\\samplebuild\ \eg\\eg1\\eg.jar\' [javac] \'-sourcepath\' [javac] \'E:\\samplebuild\\eg\\eg2\\sourcefiles\' [javac] \'-g:none\' [javac] [javac] The \' characters around the executable and arg uments are [javac] not part of the command. [javac] Files to be compiled:> Build file:> -- --David [EMAIL PROTECTED] -------------------To unsubscribe, e-mail: [EMAIL PROTECTED] additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]