<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>opyate.com</title>
    <link>http://opyate.com/site/</link>
    <description>Witty description to follow...</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.4.1 - http://www.s9y.org/</generator>
    <pubDate>Sun, 21 Jun 2009 23:44:14 GMT</pubDate>

    <image>
        <url>http://opyate.com/site/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: opyate.com - Witty description to follow...</title>
        <link>http://opyate.com/site/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Clean Ubuntu from Java mucky muck</title>
    <link>http://opyate.com/site/index.php?/archives/4-Clean-Ubuntu-from-Java-mucky-muck.html</link>
            <category>codigo ergo sum</category>
    
    <comments>http://opyate.com/site/index.php?/archives/4-Clean-Ubuntu-from-Java-mucky-muck.html#comments</comments>
    <wfw:comment>http://opyate.com/site/wfwcomment.php?cid=4</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://opyate.com/site/rss.php?version=2.0&amp;type=comments&amp;cid=4</wfw:commentRss>
    

    <author>nospam@example.com (opyate)</author>
    <content:encoded>
    As a Java developer, when installing a new Ubuntu development system, you&#039;re sometimes left with various Java tools of various flavours. Like, for instance, &lt;a href=&quot;http://gcc.gnu.org/java/&quot;  title=&quot;GNU Compiler for the Java Programming Language&quot;&gt;gcj&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;

Not only that - Debian-based systems (of which Ubuntu is one) uses the alternatives system to enable you to link the &lt;em&gt;javac&lt;/em&gt; command to various implementations of the compiler (of which afore-mentioned gcj is one; others include Sun&#039;s own compiler, and the Eclipse compiler). Since an explanation of the alternatives system is out-of-scope for this post, you can read about it here: &lt;a href=&quot;http://www.debian-administration.org/articles/91&quot;  title=&quot;Debian alternatives system&quot;&gt;Debian alternatives system&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;

So, here lies the problem: like me, you probably want to know exactly what&#039;s on your machine. You also don&#039;t want to mix your tools, e.g. compile with &lt;em&gt;gcj&lt;/em&gt;, but then run the binary with Sun&#039;s &lt;em&gt;java&lt;/em&gt; (would this even work?).&lt;br/&gt;&lt;br/&gt;

However powerful the alternatives system can be, it&#039;s a bit too... INTRUSIVE for a newcomer &lt;img src=&quot;http://opyate.com/site/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br/&gt;&lt;br/&gt;

&lt;img width=&#039;500&#039; height=&#039;333&#039; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://opyate.com/site/uploads/intrusive.jpg&quot; alt=&quot;&quot; /&gt;&lt;u&gt;*&lt;/u&gt;&lt;br/&gt;&lt;br/&gt;

Let&#039;s do some cleaning up by removing the alternative installations to all our favourite tools, then tell the OS to use our own tools. (This was tested on Ubuntu 8.04)&lt;br/&gt;&lt;br/&gt;

Firstly, start by downloading your tools from the web, e.g. JDK, Maven, Ant, etc. While the tools are downloading, let&#039;s do some cleaning up.&lt;br/&gt;&lt;br/&gt;

(You may want to read up on how the alternatives system actually work before blindly running my scripts: &lt;a href=&quot;http://www.debian.org/doc/FAQ/ch-customizing.en.html#s-diverse&quot;  title=&quot;alternatives how-to&quot;&gt;alternatives how-to&lt;/a&gt;)&lt;br/&gt;&lt;br/&gt;

Now, you can decide to completely remove Ubuntu-maintained tools from your machine by removing them with Synaptic package manager. Or you can just install the new tools, and tell the alternatives system to prefer your tools above the others. I&#039;ll follow the former method, since it frees up a bit of valuable space too.&lt;br/&gt;&lt;br/&gt;

(PS: the below is just a sample of things that may or may not be installed on your machine. Use Synaptic Package Manager instead, and search for &quot;java&quot; and remove accordingly)&lt;br/&gt;&lt;br/&gt;

&lt;pre name=&quot;code&quot; class=&quot;c++&quot;&gt;
sudo aptitude remove -y sun-java6-jdk sun-java6-jre sun-java6-bin sun-java6-plugin 
&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;

You may need to completely remove the historical alternatives:&lt;br/&gt;&lt;br/&gt;

&lt;pre name=&quot;code&quot; class=&quot;c++&quot;&gt;
update-alternatives --remove-all java
!!:gs/java/jar/
!!:gs/jar/javac/
!!:gs/javac/javah/
!!:gs/javah/javap/
!!:gs/javap/javaws/
!!:gs/javaws/jconsole/
!!:gs/jconsole/jhat/
!!:gs/jhat/jinfo/
!!:gs/jinfo/jmap/
!!:gs/jmap/jps/
!!:gs/jps/jvisualvm/
&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;

As you can see, not only do I use &lt;em&gt;java&lt;/em&gt; and &lt;em&gt;javac&lt;/em&gt;, but also &lt;em&gt;jhat&lt;/em&gt;, &lt;em&gt;jvisualvm&lt;/em&gt;, etc.
The &lt;em&gt;!!:gs/A/B/&lt;/em&gt; command basically means &quot;repeat the previous command, but replace A with B, all occurrences&quot;, as opposed to the &lt;em&gt;^A^B&lt;/em&gt; command which will only replace the first occurrence.
(There&#039;s some really powerful Linux commands out there, and here&#039;s some cool ones: &lt;a href=&quot;http://www.commandlinefu.com/commands/browse/sort-by-votes&quot;  title=&quot;commandlinefu.com&quot;&gt;commandlinefu.com&lt;/a&gt;)&lt;br/&gt;&lt;br/&gt;

Install your new JDK, set up it&#039;s environment variable in /etc/profile (e.g. JAVA_HOME=/opt/jdk/jdk1.6.0_14), and have your current shell load the variable with:&lt;br/&gt;&lt;br/&gt;

&lt;pre name=&quot;code&quot; class=&quot;c++&quot;&gt;
source /etc/profile
&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;

Tell the alternatives system where it can find the new utilities:&lt;br/&gt;&lt;br/&gt;

&lt;pre name=&quot;code&quot; class=&quot;c++&quot;&gt;
update-alternatives --install /usr/bin/java java ${JAVA_HOME}/bin/java 50
!!:gs/java/jar/
!!:gs/jar/javac/
!!:gs/javac/javah/
!!:gs/javah/javap/
!!:gs/javap/javaws/
!!:gs/javaws/jconsole/
!!:gs/jconsole/jhat/
!!:gs/jhat/jinfo/
!!:gs/jinfo/jmap/
!!:gs/jmap/jps/
!!:gs/jps/jvisualvm/
&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;

You can now try one of the above commands on the command line, and it will work:&lt;br/&gt;&lt;br/&gt;

&lt;pre name=&quot;code&quot; class=&quot;c++&quot;&gt;
$ java -version
java version &quot;1.6.0_14&quot;
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)
&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;

The same can now be done for your other tools, like Ant and Maven.&lt;br/&gt;&lt;br/&gt;

Happy coding &lt;img src=&quot;http://opyate.com/site/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br/&gt;&lt;br/&gt;

&lt;u&gt;*&lt;/u&gt; &lt;em&gt;Image attributed to http://www.flickr.com/photos/erica_marshall/3017362565/#DiscussPhoto under the Creative Commons License: http://creativecommons.org/licenses/by-nc-sa/3.0/&lt;/em&gt; 
    </content:encoded>

    <pubDate>Thu, 18 Jun 2009 20:37:20 -0700</pubDate>
    <guid isPermaLink="false">http://opyate.com/site/index.php?/archives/4-guid.html</guid>
    
</item>
<item>
    <title>And the next candidate is...</title>
    <link>http://opyate.com/site/index.php?/archives/3-And-the-next-candidate-is....html</link>
            <category>codigo ergo sum</category>
    
    <comments>http://opyate.com/site/index.php?/archives/3-And-the-next-candidate-is....html#comments</comments>
    <wfw:comment>http://opyate.com/site/wfwcomment.php?cid=3</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://opyate.com/site/rss.php?version=2.0&amp;type=comments&amp;cid=3</wfw:commentRss>
    

    <author>nospam@example.com (opyate)</author>
    <content:encoded>
    Hi, this is my 7th attempt at maintaining a blog, and I&#039;ll try and pull through this time. This blog will mostly be about my findings as a developer. A Java developer interested in the world outside of Java. Please allow me to introduce myself...&lt;br/&gt;&lt;br/&gt;

See, I fancy myself a Jack Of All Trades, but master of Java-only.&lt;br/&gt;&lt;br/&gt;

(Let me rephrase - I&#039;m no James Gosling - it&#039;s just that my Java ability way exceeds any of my other skills. &lt;a href=&quot;http://www.imdb.com/title/tt0374900/quotes&quot;  title=&quot;Napoleon Dynamite quote&quot;&gt;You know, like nunchuck skills, bowhunting skills, computer hacking skills... Girls only want boyfriends who have great skills.&lt;/a&gt;)&lt;br/&gt;&lt;br/&gt;

In primary school comp sci class [1992] we hacked with Basic and Logo on DOS.&lt;br/&gt;
In high school comp sci class [1993-1997] we hacked with Pascal, C and the occasional sneaky inline Assembly on Windows 95 and Slackware.&lt;br/&gt;
Uni [1998-2001] was all about C++ (engineering and personal &lt;a href=&quot;http://en.wikipedia.org/wiki/Demoscene&quot;  title=&quot;demo scene&quot;&gt;demo scene&lt;/a&gt; interest) on Windows 98/XP and RedHat.&lt;br/&gt;
Then life with its bills and increasing waistlines [2003&lt;u&gt;*&lt;/u&gt;-now] began. A &lt;a href=&quot;https://launchpad.net/~amanica&quot;  title=&quot;Marius Kruger&quot;&gt;mate from uni&lt;/a&gt;, whom I&#039;ll forever be thankful to (and for) gave me a call one night, told me about this small company that needed a Java guy, and asked if I were up for it. Not professionally, of course, if you read the footnote indicated by &lt;u&gt;*&lt;/u&gt; a few moments ago. But I locked myself into a dark room armed only with the purest coffee, my trusty Pentium II and a hundred or so cigarettes.&lt;br/&gt;&lt;br/&gt;

&lt;em&gt;Then the love affair began.&lt;/em&gt;&lt;br/&gt;&lt;br/&gt;

&lt;img src=&quot;http://opyate.com/site/uploads/top_there.jpg&quot; alt=&quot;&quot; /&gt;&lt;br/&gt;&lt;br/&gt;

I devoured Java and everything the company threw at me: Bash scripting, HTML, JavaScript, SQL. I think if I were ever to be shown my code from back then, my eyes will implode. But I learned, and I dug the Java thang.&lt;br/&gt;&lt;br/&gt;

Subsequent jobs introduced my to Cold Fusion, Ruby on Rails, Groovy and Perl (mostly light CGI and screen scraping using &lt;a href=&quot;http://search.cpan.org/dist/WWW-Mechanize/&quot;  title=&quot;Mechanize&quot;&gt;Mechanize&lt;/a&gt;) but I was the Master and Java my &lt;a href=&quot;http://en.wikipedia.org/wiki/The_Master_and_Margarita&quot;  title=&quot;Margarita&quot;&gt;Margarita&lt;/a&gt;. (terrible analogy, but I get to use the word &quot;master&quot; &lt;img src=&quot;http://opyate.com/site/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; )&lt;br/&gt;&lt;br/&gt;

Cue Perl and Catalyst. This is my next big adventure. (And the Scala book just arrived in the post)&lt;br/&gt;&lt;br/&gt;

Let&#039;s see where this leads... Pleased to meet you &lt;img src=&quot;http://opyate.com/site/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br/&gt;&lt;br/&gt;

&lt;u&gt;*&lt;/u&gt;&lt;em&gt; I braced uni with my presence for a full 2 years after which life as an axe-wielding rock star seemed more fun. The fun was over before you could say &quot;metal does not pay bills in Africa&quot;. I then returned to uni to complete a diploma in AI/Neural Nets at which point I got the phone call. I&#039;ve lived in London for 5 years now, btw, where metal is now just a past-time.&lt;/em&gt; 
    </content:encoded>

    <pubDate>Thu, 12 Mar 2009 21:56:06 -0700</pubDate>
    <guid isPermaLink="false">http://opyate.com/site/index.php?/archives/3-guid.html</guid>
    
</item>

</channel>
</rss>
