<?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>cwash into software &#187; upgrade</title>
	<atom:link href="http://cwash.org/tag/upgrade/feed/" rel="self" type="application/rss+xml" />
	<link>http://cwash.org</link>
	<description>+= construction + craftsmanship;</description>
	<lastBuildDate>Thu, 29 Sep 2011 04:23:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>Java 6 and Maven 2.0.9 on Leopard</title>
		<link>http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=java-6-and-maven-209-on-leopard</link>
		<comments>http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 07:21:42 +0000</pubDate>
		<dc:creator>Chris Wash</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[CapTech]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://cwash.org/?p=31</guid>
		<description><![CDATA[A discussion/walk through of how to set up Java 6 and upgrade Maven (that is now included in the OS) in Leopard.]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><p>Trying to run through a screencast I&#8217;m putting together after upgrading to Leopard, I noticed Maven giving me a <a href="http://www.nabble.com/archetype-generate%2C-goal-not-found-td17001546.html#a17251047" target="_blank">strange error</a> when trying to run archetype:generate and realized that Leopard includes its own version of Maven (and Ant) out of the box.  The problem is that it&#8217;s version 2.0.6, which doesn&#8217;t have support for this feature.  I then set about trying to upgrade Maven (and in the process, Java) and here is what I uncovered.<span id="more-31"></span></p>
<p>First of all, I screwed myself over a bit by customizing my /etc/profile under Tiger; there were changes to this file that came in with Leopard but I can&#8217;t see where the updater tried to merge them in at all.  There are changes in Leopard to how paths are configured using a script called /etc/path_helper, but I don&#8217;t have any of that getting executed.  It took me a while to figure out this was the reason my .profile, .bash_profile, etc weren&#8217;t getting source&#8217;d properly.  What I did was pull out all of my updates to /etc/profile and just add in the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">source</span> ~<span style="color: #000000; font-weight: bold;">/</span>.profile</div></div>
<p>So at least now I have my .profile getting loaded properly.  I&#8217;d still be interested to see someone&#8217;s /etc/profile that works out of the box with the call to /etc/path_helper, but this is all beside the point.</p>
<p>Applying the Java update was painless – it worked fine through the Apple Software Update utility.  You can download it <a href="http://support.apple.com/downloads/Java_for_Mac_OS_X_10_5_Update_2" target="_blank">here</a> manually if you need to.</p>
<p>Next, you&#8217;ll probably notice that Java 6 isn&#8217;t enabled by default.  <a href="http://blog.libinpan.com/2008/04/29/java-se-6-on-leopard-officially/" target="_blank">This blog</a> will show you how to switch over to 6 using the Java Preferences utility.  There is a flaw in the ointment, though – for some reason it appears that it doesn&#8217;t switch over all of the symlinks properly.  Maven&#8217;s startup script gets confused by this in a few steps.  You can read more about it in <a href="http://www.nabble.com/-jira--Created:-(MNG-3707)-mvn-script-cannot-compile-sources-which-use-java-1.6-classes-if-JAVA_HOME-is-set-td18967741.html" target="_blank">this message</a> (some JIRA comments) from their mailing list.  The workaround is to just point your JAVA_HOME directly to the 1.6/Home directory.</p>
<p>You can install the newer version of Maven at this point.  I saw <a href="http://www.kelvinwong.ca/2008/11/10/upgrade-your-maven-on-os-x-leopard/" target="_blank">this post</a> detailing the instructions, but it was what I expected.  Just download the latest version and extract it to where you keep these kinds of things.  Then you just have to update your .profile (or .bash_profile) to set up some environmental variables for you.  Here&#8217;s what I included in my ~/.profile:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">JAVA_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>JavaVM.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.6</span><span style="color: #000000; font-weight: bold;">/</span>Home<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">M2_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>Java<span style="color: #000000; font-weight: bold;">/</span>apache-maven-2.0.9<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">M2</span>=<span style="color: #007800;">$M2_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$M2</span>:<span style="color: #007800;">$PATH</span></div></div>
<p>You&#8217;ll need to do source ~/.profile or exit out of your terminal and open it up again for the changes to take effect.  Once you do you can test to make sure you&#8217;re seeing the right version of Maven:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cwash:~ chris$ which mvn<br />
/Java/apache-maven-2.0.9/bin/mvn</div></div>
<p>You can also check this by doing:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cwash:~ chris$ mvn -v<br />
Maven version: 2.0.9<br />
Java version: 1.6.0_07<br />
OS name: &quot;mac os x&quot; version: &quot;10.5.5&quot; arch: &quot;x86_64&quot; Family: &quot;mac&quot;</div></div>
<p>I guess we can chalk this one up to kicking the tires on Leopard.  Hope this makes the process a little less painless for someone else!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=24&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=102&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-gmail">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=52&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=74&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=207&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=6&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=4&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Java+6+and+Maven+2.0.9+on+Leopard&amp;link=http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/&amp;notes=A%20discussion%2Fwalk%20through%20of%20how%20to%20set%20up%20Java%206%20and%20upgrade%20Maven%20%28that%20is%20now%20included%20in%20the%20OS%29%20in%20Leopard.&amp;short_link=http://bit.ly/aT7bVG&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul><div style="clear: both;"></div></div>

<h3  class="related_post_title">More Related Content</h3><ul class="related_post"><li>June 3, 2009 -- <a href="http://cwash.org/2009/06/03/what-is-hamcrest/" title="What is Hamcrest?">What is Hamcrest?</a> (0)</li><li>April 15, 2009 -- <a href="http://cwash.org/2009/04/15/osgi-ggity-giggity/" title="OSGi-ggity-Giggity">OSGi-ggity-Giggity</a> (4)</li><li>August 1, 2008 -- <a href="http://cwash.org/2008/08/01/new-apple-wireless-keyboard/" title="New Apple Wireless Keyboard">New Apple Wireless Keyboard</a> (1)</li><li>July 21, 2008 -- <a href="http://cwash.org/2008/07/21/pimp-my-build/" title="Pimp My Build">Pimp My Build</a> (0)</li><li>July 8, 2010 -- <a href="http://cwash.org/2010/07/08/transactions-part-1/" title="Transactions, Part 1">Transactions, Part 1</a> (0)</li><li>January 7, 2010 -- <a href="http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/" title="Eliminate Branching (IF Statements) to Produce Better Code">Eliminate Branching (IF Statements) to Produce Better Code</a> (0)</li><li>July 29, 2009 -- <a href="http://cwash.org/2009/07/29/what-id-tell-myself-about-design-if-i-were-just-beginning/" title="What I&#8217;d Tell Myself About Design If I Were Just Beginning">What I&#8217;d Tell Myself About Design If I Were Just Beginning</a> (5)</li><li>July 24, 2009 -- <a href="http://cwash.org/2009/07/24/the-elements-of-reusable-code/" title="The Elements of Reusable Code">The Elements of Reusable Code</a> (0)</li><li>June 9, 2009 -- <a href="http://cwash.org/2009/06/09/mocking-with-jmockit/" title="Mocking with JMockit">Mocking with JMockit</a> (5)</li><li>November 28, 2008 -- <a href="http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/" title="Must Haves/References For Modern Java EE Developers">Must Haves/References For Modern Java EE Developers</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

