You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Dave Inskeep <da...@bea.com> on 2000/10/24 17:54:26 UTC

javac task and classpath attribute

Does anyone else have problems with using the classpath attribute, 
classpath nested element, or classpathref attribute with the javac task? No 
matter what I try, javac seems to ignore the classpath and use what ant ran 
with. In desperation I even just tried:

<javac srcdir="${src.dir}" destdir="${build.dir}" classpath="foo"/>

hoping to see my classpath as foo. However, this is what I get with "ant 
-verbose":

[javac] Compilation args: jikes -d C:\Projects\beast\classes -classpath 
"C:\Program 
Files\JavaSoft\JRE\1.2\lib\ext\iiimp.jar;C:\Projects\beast\classes;C:\java\ant\lib\ant.jar;C:\java\ant\lib\jaxp.jar;C:\java\ant\lib\parser.jar;C:\java\jdk1.2.2\lib\tools.jar;C:\Program 
Files\JavaSoft\JRE\1.2\lib\rt.jar;C:\Projects\beast\src"

It appears to be just the classpath that the ant batch file uses plus my 
srcdir and destdir. Am I missing something obvious? I'm using version ant 1.2.

Thanks,
Dave


RE: javac task and classpath attribute

Posted by Dave Inskeep <da...@bea.com>.
Alan, Diane, thanks for the reference points. At least I know it's 
something I'm doing wrong. I have found that if I use the bootclasspath 
attribute of javac it works. I also wonder if it's a jikes vs javac 
compiler thing. Anyway, since I know that it works for other people, I'll 
keep plugging away.

Thanks,
Dave

At 12:48 PM 10/24/00 -0400, you wrote:
>Dave -
>
>I have been able to use it successful, as Diane. Here's how I've set it up 
>on one build ...
>(ANT version 1.1, Java 1.2.2, NT 4.0 sp5 )
>*******************
>         <target name="make" depends="init">
>                 <mkdir dir="${classes}" />
>                 <javac srcdir="${source}"
>                                 destdir="${classes}"
>                                 deprecation="${deprecationValue}"
>                                 optimize="${optimizeValue}"
>                                 target="${targetValue}"
>                                 debug="${debugValue}" >
>
>                                         <!--    The following JAR files 
> need to be updated with new libraries as used   -->
>                                 <classpath>
>                                         <pathelement 
> location="${lib}/fast.jar"/>
>                                         <pathelement 
> location="${lib}/lotusxsl.jar"/>
>                                         <pathelement 
> location="${lib}/xml4j.jar"/>
>                                         <pathelement 
> location="${lib}/ldapjdk.jar"/>
>                                         <pathelement 
> location="${lib}/ldapfilt.jar"/>
>                                         <pathelement 
> location="${lib}/ldapsp.jar"/>
>                                         <pathelement 
> location="${lib}/mail.jar"/>
>                                         <pathelement 
> location="${lib}/activation.jar"/>
>                                 </classpath>
>                 </javac>
>         </target>
>*******************
>
>-----Original Message-----
>From: Dave Inskeep [mailto:dave.inskeep@bea.com]
>Sent: Tuesday, October 24, 2000 11:54 AM
>To: ant-user@jakarta.apache.org
>Subject: javac task and classpath attribute
>
>
>Does anyone else have problems with using the classpath attribute,
>classpath nested element, or classpathref attribute with the javac task? No
>matter what I try, javac seems to ignore the classpath and use what ant ran
>with. In desperation I even just tried:
>
><javac srcdir="${src.dir}" destdir="${build.dir}" classpath="foo"/>
>
>hoping to see my classpath as foo. However, this is what I get with "ant
>-verbose":
>
>[javac] Compilation args: jikes -d C:\Projects\beast\classes -classpath
>"C:\Program
>Files\JavaSoft\JRE\1.2\lib\ext\iiimp.jar;C:\Projects\beast\classes;C:\java\ant\lib\ant.jar;C:\java\ant\lib\jaxp.jar;C:\java\ant\lib\parser.jar;C:\java\jdk1.2.2\lib\tools.jar;C:\Program 
>
>Files\JavaSoft\JRE\1.2\lib\rt.jar;C:\Projects\beast\src"
>
>It appears to be just the classpath that the ant batch file uses plus my
>srcdir and destdir. Am I missing something obvious? I'm using version ant 1.2.
>
>Thanks,
>Dave


RE: javac task and classpath attribute

Posted by Alan Gerhard <AG...@E-SyncNet.Com>.
Dave -

I have been able to use it successful, as Diane. Here's how I've set it up on one build ...
(ANT version 1.1, Java 1.2.2, NT 4.0 sp5 )
*******************
	<target name="make" depends="init">
		<mkdir dir="${classes}" />
		<javac srcdir="${source}" 
				destdir="${classes}" 
				deprecation="${deprecationValue}"
				optimize="${optimizeValue}"
				target="${targetValue}"
				debug="${debugValue}" >

			 		<!--	The following JAR files need to be updated with new libraries as used	-->
				<classpath>
					<pathelement location="${lib}/fast.jar"/>
					<pathelement location="${lib}/lotusxsl.jar"/>
					<pathelement location="${lib}/xml4j.jar"/>
					<pathelement location="${lib}/ldapjdk.jar"/>
					<pathelement location="${lib}/ldapfilt.jar"/>
					<pathelement location="${lib}/ldapsp.jar"/>
					<pathelement location="${lib}/mail.jar"/>
					<pathelement location="${lib}/activation.jar"/>
				</classpath>
		</javac>
	</target>
*******************

-----Original Message-----
From: Dave Inskeep [mailto:dave.inskeep@bea.com]
Sent: Tuesday, October 24, 2000 11:54 AM
To: ant-user@jakarta.apache.org
Subject: javac task and classpath attribute


Does anyone else have problems with using the classpath attribute, 
classpath nested element, or classpathref attribute with the javac task? No 
matter what I try, javac seems to ignore the classpath and use what ant ran 
with. In desperation I even just tried:

<javac srcdir="${src.dir}" destdir="${build.dir}" classpath="foo"/>

hoping to see my classpath as foo. However, this is what I get with "ant 
-verbose":

[javac] Compilation args: jikes -d C:\Projects\beast\classes -classpath 
"C:\Program 
Files\JavaSoft\JRE\1.2\lib\ext\iiimp.jar;C:\Projects\beast\classes;C:\java\ant\lib\ant.jar;C:\java\ant\lib\jaxp.jar;C:\java\ant\lib\parser.jar;C:\java\jdk1.2.2\lib\tools.jar;C:\Program 
Files\JavaSoft\JRE\1.2\lib\rt.jar;C:\Projects\beast\src"

It appears to be just the classpath that the ant batch file uses plus my 
srcdir and destdir. Am I missing something obvious? I'm using version ant 1.2.

Thanks,
Dave