<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ghattu&#039;s Technology Blog &#187; ant</title>
	<atom:link href="http://ghattus.com/tag/ant/feed/" rel="self" type="application/rss+xml" />
	<link>http://ghattus.com</link>
	<description>A blog about technology that I work on in my day to day job</description>
	<lastBuildDate>Thu, 03 Dec 2009 00:56:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Bizarre ant failure &#8211; Unknown argument: -cp</title>
		<link>http://ghattus.com/2009/08/02/bizarre-ant-failure-unknown-argument-cp/</link>
		<comments>http://ghattus.com/2009/08/02/bizarre-ant-failure-unknown-argument-cp/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 16:43:09 +0000</pubDate>
		<dc:creator>sghattu</dc:creator>
				<category><![CDATA[ant]]></category>
		<category><![CDATA[ANT_HOME]]></category>
		<category><![CDATA[PATH]]></category>

		<guid isPermaLink="false">http://ghattus.com/?p=51</guid>
		<description><![CDATA[Annoying ant error "Unknown argument: -cp" due to ANT_HOME and PATH mismatch.]]></description>
			<content:encoded><![CDATA[<p>Recently I started running into this weird ant error that was causing a lot of our builds fail.<span id="more-51"></span></p>
<blockquote><p><em>[root]#ant</em></p>
<p><em>Unknown argument: -cp<br />
ant [options] [target [target2 [target3] &#8230;]]<br />
Options:<br />
-help, -h              print this message<br />
-projecthelp, -p       print project help information<br />
-version               print the version information and exit<br />
-diagnostics           print information that might be helpful to<br />
diagnose or report problems.<br />
-quiet, -q             be extra quiet<br />
-verbose, -v           be extra verbose<br />
-debug, -d             print debugging information<br />
-emacs, -e             produce logging information without adornments<br />
-lib &lt;path&gt;            specifies a path to search for jars and classes<br />
-logfile &lt;file&gt;        use given file for log<br />
-l     &lt;file&gt;                &#8221;<br />
-logger &lt;classname&gt;    the class which is to perform logging<br />
-listener &lt;classname&gt;  add an instance of class as a project listener<br />
-noinput               do not allow interactive input<br />
-buildfile &lt;file&gt;      use given buildfile<br />
-file    &lt;file&gt;              &#8221;<br />
-f       &lt;file&gt;              &#8221;<br />
-D&lt;property&gt;=&lt;value&gt;   use value for given property<br />
-keep-going, -k        execute all targets that do not depend<br />
on failed target(s)<br />
-propertyfile &lt;name&gt;   load all properties from file with -D<br />
properties taking precedence<br />
-inputhandler &lt;class&gt;  the class which will handle input requests<br />
-find &lt;file&gt;           (s)earch for buildfile towards the root of<br />
-s  &lt;file&gt;           the filesystem and use it<br />
-nice  number          A niceness value for the main thread:<br />
1 (lowest) to 10 (highest); 5 is the default</em></p></blockquote>
<p>I did a google search on &#8220;ant Unknown argument: -cp&#8221; and ended up with a pretty decent number of <a href="http://www.google.com/search?q=ant+Unknown+argument%3A+-cp&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a">hits</a>. But unfortunately none of them seem to offer a simple and elegant solution to my problem. The solution ranged from deleting a file from /etc directory to changing the ant script itself, which were definately not acceptable due to the fact that these builds were working perfectly before. After some digging around I found why this occured in my environment. Apparently Ant does not like if the ANT_HOME is different from the location of ANT&#8217;s bin in the PATH variable. For example, I had my ANT_HOME as</p>
<blockquote><p><em>echo $ANT_HOME</em></p>
<p><em>/opt/ant170</em></p></blockquote>
<p>And the PATH is set to point to a different version of ANT as,</p>
<blockquote><p><em>echo $PATH</em></p>
<p><em>/usr/kerberos/sbin:/usr/kerberos/bin:/sbin:/bin:/usr/sbin:/usr/bin:</em></p>
<p><em>/opt/1.6.2a/bin:/opt/java/1.5/bin</em></p></blockquote>
<p>Setting my PATH to the right ANT&#8217;s bin directory fixed the problem.. <img src='http://ghattus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ghattus.com/2009/08/02/bizarre-ant-failure-unknown-argument-cp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

