<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Finally, A Question!  Ant classpath issues"]]></title>
		<link>http://forums.hotjoe.com/posts/list/3.page</link>
		<description><![CDATA[Latest messages posted in the topic "Finally, A Question!  Ant classpath issues"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Finally, A Question!  Ant classpath issues</title>
				<description><![CDATA[ Finally my build is over with, well we deploy tomorrow so now I have some time to play around with all the neat tools that i've put on the to-do list. <br /> <br /> <br /> First up, ant. <br /> <br /> I was playing around with it, and it seems pretty straight forward. I did run into a problem with using the &lt;classpath&gt; option  as in...<br /> <br /> [code]<br /> &lt;target name="compileProject" description="compiles project Classes"&gt;<br /> 	&lt;echo&gt;compiling the project classes&lt;/echo&gt;<br /> &lt;!--	&lt;classpath path="${junitClassPath}"/&gt;--&gt;<br /> 	&lt;classpath&gt;<br /> 		&lt;pathelement path="c:\files"/&gt;<br /> 	&lt;/classpath&gt;<br /> 	&lt;javac srcdir="${src}" destdir="${build}"/&gt;<br /> &lt;/target&gt;<br /> [/code]<br /> <br /> Note: i tried doing it both ways Inlining, and umm not inlining.   (i am aware that ant has junit tags to do stuff for me, I'll get to it eventually) <br /> <br /> basically it gives me an error and some things to try and ant tells me to not submit a bug report. <br /> <br /> This is what it looks like:<br /> [quote]<br /> Ant could not find the task or a class this task relies upon.<br /> <br /> This is common and has a number of causes; the usual<br /> solutions are to read the manual pages then download and<br /> install needed JAR files, or fix the build file:<br />  - You have misspelt 'classpath'.<br />    Fix: check your spelling.<br />  - The task needs an external JAR file to execute<br />      and this is not found at the right place in the classpath.<br />    Fix: check the documentation for dependencies.<br />    Fix: declare the task.<br />  - The task is an Ant optional task and the JAR file and/or libraries<br />      implementing the functionality were not found at the time you<br />      yourself built your installation of Ant from the Ant sources.<br />    Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the<br />      task and make sure it contains more than merely a META-INF/MANIFEST.MF.<br />      If all it contains is the manifest, then rebuild Ant with the needed<br />      libraries present in ${ant.home}/lib/optional/ , or alternatively,<br />      download a pre-built release version from apache.org<br />  - The build file was written for a later version of Ant<br />    Fix: upgrade to at least the latest release version of Ant<br />  - The task is not an Ant core or optional task<br />      and needs to be declared using &lt;taskdef&gt;.<br />  - You are attempting to use a task defined using<br />     &lt;presetdef&gt; or &lt;macrodef&gt; but have spelt wrong or not<br />    defined it at the point of use<br /> <br /> Remember that for JAR files to be visible to Ant tasks implemented<br /> in ANT_HOME/lib, the files must be in the same directory or on the<br /> classpath<br /> <br /> Please neither file bug reports on this problem, nor email the<br /> Ant mailing lists, until all of these causes have been explored,<br /> as this is not an Ant bug.<br /> [/quote]<br /> <br /> <br /> Long story short I don't know what it's asking for, or telling me what to do. (other than don't submit a bug report) <br /> <br /> The help at the Ant site [url=http://ant.apache.org/faq.html#delegating-classloader-1.6] here [/url] Didn't have too much to say. Something about classloaders and I think it's suggesting that I put all my jars in the ANT_HOME/lib directory.  <br /> The faq says to use the -lib switch on startup but that seems to disable which target I can pick. <br /> <br /> IE<br /> <br /> [code]<br /> ant clean //runs clean target<br /> ant -lib clean //looks for external resources in clean and runs the default target<br /> ant -lib clean clean //gives me the same error as above<br /> [/code]<br /> <br /> The help item also seems to be directly related to not finding the &lt;junit&gt; or the &lt;style&gt; tags not the &lt;classpath&gt; tag.  It seems like it's hanging on the classpath tag, considering I'm not using the style or junit tags.<br /> <br /> I know there are a couple of workarounds, The most obvious being a .cmd command to set the classpath and I can then go about using ANT from there. I can also set all this stuff into the environment, but that gets messy. <br /> <br /> Any ideas on how to work around this? Am i missing something? ]]></description>
				<guid isPermaLink="true">http://forums.hotjoe.com/posts/preList/9/17.page</guid>
				<link>http://forums.hotjoe.com/posts/preList/9/17.page</link>
				<pubDate><![CDATA[Fri, 30 Sep 2005 16:06:19]]> GMT</pubDate>
				<author><![CDATA[ tfecw]]></author>
			</item>
			<item>
				<title>Re:Finally, A Question!  Ant classpath issues</title>
				<description><![CDATA[ You want to set the classpath as a child of javac:<br /> <br /> [code]<br /> &lt;target name="compileProject" description="compiles project Classes"&gt;<br />  	&lt;echo&gt;compiling the project classes&lt;/echo&gt;<br />  	&lt;javac srcdir="${src}" destdir="${build}"&gt;<br />  	    &lt;classpath&gt;<br />  		    &lt;pathelement path="c:\files"/&gt;<br />  	    &lt;/classpath&gt;<br />  	&lt;/javac&gt;<br />  &lt;/target&gt;<br /> [/code]<br /> <br /> Also, do you mean to have just a directory as the pathelement?  Normally it'll be something more like:<br /> <br /> [code]<br /> &lt;path id="files-classpath"&gt;<br />     &lt;fileset dir="c:/files" &gt;<br />         &lt;include name="*.jar"/&gt;<br />     &lt;/fileset&gt;<br /> &lt;/path&gt;<br /> <br /> ...<br /> <br /> &lt;target name="compileProject" description="compiles project Classes"&gt;<br />     &lt;echo&gt;compiling the project classes&lt;/echo&gt;<br />     &lt;javac srcdir="${src}" destdir="${build}"&gt;<br />         &lt;classpath&gt;<br />             &lt;path refid="files-classpath" /&gt;<br />  	&lt;/classpath&gt;<br />     &lt;/javac&gt;<br /> &lt;/target&gt;<br /> [/code]<br /> <br /> Lastly, ant and Java prefer forward slashes even in Windows.  The backslash tend to be escape characters and can confuse things.]]></description>
				<guid isPermaLink="true">http://forums.hotjoe.com/posts/preList/9/18.page</guid>
				<link>http://forums.hotjoe.com/posts/preList/9/18.page</link>
				<pubDate><![CDATA[Fri, 30 Sep 2005 21:35:28]]> GMT</pubDate>
				<author><![CDATA[ stdunbar]]></author>
			</item>
			<item>
				<title>Re:Finally, A Question!  Ant classpath issues</title>
				<description><![CDATA[ Ahh very cool. <br /> <br /> Forward slashes...check.  <br /> <br /> As for the directory I just tossed in "c:\files" to make sure that junit wasn't interfering with anything. (silly I know, there was no real logic thought behind the maneuver) <br /> <br /> Thanks for the help! I guess my tutorial failed to mention that classpath needed to be a child of javac. That or I failed to actually read the words instead of looking at the examples, which I’ve been guilt of many times. I'm not set up at home yet, but I'll give it a shot later tonight or tomorrow.<br /> <br /> ]]></description>
				<guid isPermaLink="true">http://forums.hotjoe.com/posts/preList/9/19.page</guid>
				<link>http://forums.hotjoe.com/posts/preList/9/19.page</link>
				<pubDate><![CDATA[Fri, 30 Sep 2005 21:45:00]]> GMT</pubDate>
				<author><![CDATA[ tfecw]]></author>
			</item>
	</channel>
</rss>
