<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Useless Inc. - Development|Java</title>
    <link>http://www.tomergabel.com/</link>
    <description>Tomer Gabel's annoying spot on the 'net</description>
    <language>en-us</language>
    <copyright>Tomer Gabel</copyright>
    <lastBuildDate>Thu, 02 Aug 2012 07:20:42 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>tomer@tomergabel.com</managingEditor>
    <webMaster>tomer@tomergabel.com</webMaster>
    <item>
      <trackback:ping>http://www.tomergabel.com/Trackback.aspx?guid=b8d6056d-cdf8-49a7-ac8c-d4424a965720</trackback:ping>
      <pingback:server>http://www.tomergabel.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.tomergabel.com/PermaLink,guid,b8d6056d-cdf8-49a7-ac8c-d4424a965720.aspx</pingback:target>
      <dc:creator>Tomer Gabel</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This post attempts to summarize and clarify a lecture given at the <a href="https://www.facebook.com/botzia">Botzia</a> (Israeli
Java user group) meeting on May 3rd, 2012. You can view the presentation in its entirety
on SlideShare:
</p>
        <p style="text-align: center;">
          <iframe src="http://www.slideshare.net/slideshow/embed_code/12803578" style="border: 1px solid #CCC; border-width: 1px 1px 0; margin-bottom: 5px;" width="512" height="421" scrolling="no" marginwidth="0" marginheight="0" frameborder="0">
          </iframe>
        </p>
        <div style="margin-bottom: 5px; text-align: center;">
          <strong>
            <a title="Scala in practice" href="http://www.slideshare.net/holograph/scala-in-practice-12803578" target="_blank">Scala
in practice</a>
          </strong> from <strong><a href="http://www.slideshare.net/holograph" target="_blank">Tomer
Gabel</a></strong></div>
        <h3>What is Scala?
</h3>
        <p>
          <a href="http://www.scala-lang.org/">Scala</a> is a modern, statically-typed language
designed to run on the Java platform. It's commonly perceived as an "evolutionary
Java" and with good reason: Scala adds powerful features while significantly reducing
Java's verbosity. It is a highly practical language in that it offers a very straightforward
migration path for developers on existing platforms: Java developers will feel right
at home with Scala, and a .NET developers will not have to give up on a lot of the
advantages C# has over Java.
</p>
        <p>
For organizations with a preexisting codebase Scala offers an excellent balance between
power and feature set, as well as perfect interoperability with existing Java code:
although you certainly don't <em>have </em>to, you can freely use familiar libraries
without a hitch, call into existing code and, for the most part, use your existing
tool-chain with little or no impact.
</p>
        <h3>Why did we pick Scala?
</h3>
        <p>
As mentioned above, Scala offers a very compelling migration path from an existing
Java codebase. When we were setting up the new R&amp;D center at <a href="http://www.newbrandanalytics.com">newBrandAnalytics</a>,
we were already serving paying customers via a complex codebase. A complete rewrite
was out of the question as we had contractual obligations, and we had to keep improving
the existing product in order to maintain the competitive edge; it became very clear
that we needed to maintain the existing codebase and refactor it incrementally.
</p>
        <p>
An additional data point was that our core team members were highly experienced with
Java development and quite comfortable with the platform; we also had a distinct preference
for statically typed languages, which ruled several alternatives (particularly Clojure)
right out. Scala seemed like a great compromise in that it allowed us to maintain
and extend the existing codebase while enjoying advanced language features and improved
veracity at little or no risk to the product itself.
</p>
        <h3>How should I "sell" Scala to my boss?
</h3>
        <p>
          <strong>"Safe" choice with proven track record: </strong>Scala is not an entirely
new language, and has reached a maturity tipping point at 2.8; over the last two years
the language has been gaining significant momentum, and has a number of strong advocates
and success stories, including Twitter, Foursquare, LinkedIn and a <a href="http://www.quora.com/Startups/What-startups-or-tech-companies-are-using-Scala">whole
host of others</a>.
</p>
        <p>
          <strong>Scala as a better Java:</strong> You don't have to go all-in on Scala's advanced
feature set, but can instead think of Scala as an improved Java with type inference,
closures, advanced collection framework, traits and pattern matching; these features
alone will increase your developers' happiness by an order of magnitude, and productivity
will see a corresponding improvement. 
</p>
        <p>
          <strong>Less code ⇒ less bugs</strong>: Scala code is far more concise than corresponding
Java code, an helps the developer focus on the "what" instead of the "how". The resulting
code is usually much shorter, clearer and simpler, which in turn helps lower bug count.
</p>
        <p>
          <strong>Helps hire better engineers:</strong> Great engineers not only love working
with the latest technologies, but also love practical, incremental improvements to
well-respected technologies. Merely saying "we use Scala" will help attract the sort
of seasoned, reliable and professional engineers that you most want to hire.
</p>
        <h3>Where does Scala put you at risk?
</h3>
        <p>
          <strong>Learning curve:</strong> Although Scala largely derives from Java, it's a
whole new language with a lot of features that takes time to master. Don't expect
your developers to be productive from day one; instead, provide opportunities for
experimentation and encourage iterative development (and yes, give your developers
time and mandate to throw away badly written early code and redo their work if necessary).
There is actually a lot of material on Scala and an active and vibrant community;
specifically, your developers can easily find help (and answers) on <a href="http://www.stackoverflow.com">StackOverflow</a>.
</p>
        <p>
          <strong>Rough edges: </strong>Scala is fairly new, and consequently a lot of things
that you take for granted with Java are not as mature or robust with Scala. IDE support
is a moving target: Eclipse and IntelliJ IDEA both have actively developed Scala plugins
and both have occasional issues (spurious error highlighting, lackluster performance,
wonky debuggers). The common build tools support Scala, but don't play as nicely;
for example, only the native build tool (sbt) support incremental compilation. Even
the compiler itself is not entirely bug-free, although these are getting very rare
indeed. Bottom line: expect occasional problems, and be patient while working around
them; even better, <strong>encourage your engineers to participate in the community</strong>,
file bugs and even offer patches where possible.
</p>
        <p>
          <strong>Production characteristics:</strong> While it runs on the JVM, Scala is <em>not</em> Java;
there are subtle differences that you should be aware of when maintaining large-scale
or highly-available software. Scala generates a great deal of synthetic code, which
puts additional pressure on the PermGen space; synthetic stack frames may also exhibit
significantly increased stack usage. Scala also creates a lot of intermediate objects
at runtime, which results in added eden generation churn. You may want to profile
your applications and tune the GC accordingly.
</p>
        <h3>What's the bottom line?
</h3>
        <p>
          <img style="display: block; margin-left: auto; margin-right: auto;" title="codebase-evolution.png" src="http://www.tomergabel.com/content/binary/codebase-evolution.png" alt="Codebase evolution" width="600" height="450" border="0" />
        </p>
        <p>
Scala is fantastic. Our team at newBrandAnalytics is remarkably happier with Scala
despite the occasional hitches, and I doubt any of us will consider going back to
Java given the option. As long as you keep in mind that <em>on the bleeding edge you
may get cut</em>, I definitely recommend taking the plunge, with contractors and die-hard
traditional enterprises the possible exceptions.
</p>
        <img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=b8d6056d-cdf8-49a7-ac8c-d4424a965720" />
      </body>
      <title>Scala In Practice: A Case Study</title>
      <guid isPermaLink="false">http://www.tomergabel.com/PermaLink,guid,b8d6056d-cdf8-49a7-ac8c-d4424a965720.aspx</guid>
      <link>http://www.tomergabel.com/ScalaInPracticeACaseStudy.aspx</link>
      <pubDate>Thu, 02 Aug 2012 07:20:42 GMT</pubDate>
      <description>&lt;p&gt;
This post attempts to summarize and clarify a lecture given at the &lt;a href="https://www.facebook.com/botzia"&gt;Botzia&lt;/a&gt; (Israeli
Java user group) meeting on May 3rd, 2012. You can view the presentation in its entirety
on SlideShare:
&lt;/p&gt;
&lt;p style="text-align: center;"&gt;
&lt;iframe src="http://www.slideshare.net/slideshow/embed_code/12803578" style="border: 1px solid #CCC; border-width: 1px 1px 0; margin-bottom: 5px;" width="512" height="421" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;div style="margin-bottom: 5px; text-align: center;"&gt;&lt;strong&gt; &lt;a title="Scala in practice" href="http://www.slideshare.net/holograph/scala-in-practice-12803578" target="_blank"&gt;Scala
in practice&lt;/a&gt; &lt;/strong&gt; from &lt;strong&gt;&lt;a href="http://www.slideshare.net/holograph" target="_blank"&gt;Tomer
Gabel&lt;/a&gt;&lt;/strong&gt;
&lt;/div&gt;
&lt;h3&gt;What is Scala?
&lt;/h3&gt;
&lt;p&gt;
&lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt; is a modern, statically-typed language
designed to run on the Java platform. It's commonly perceived as an "evolutionary
Java" and with good reason: Scala adds powerful features while significantly reducing
Java's verbosity. It is a highly practical language in that it offers a very straightforward
migration path for developers on existing platforms: Java developers will feel right
at home with Scala, and a .NET developers will not have to give up on a lot of the
advantages C# has over Java.
&lt;/p&gt;
&lt;p&gt;
For organizations with a preexisting codebase Scala offers an excellent balance between
power and feature set, as well as perfect interoperability with existing Java code:
although you certainly don't &lt;em&gt;have &lt;/em&gt;to, you can freely use familiar libraries
without a hitch, call into existing code and, for the most part, use your existing
tool-chain with little or no impact.
&lt;/p&gt;
&lt;h3&gt;Why did we pick Scala?
&lt;/h3&gt;
&lt;p&gt;
As mentioned above, Scala offers a very compelling migration path from an existing
Java codebase. When we were setting up the new R&amp;amp;D center at &lt;a href="http://www.newbrandanalytics.com"&gt;newBrandAnalytics&lt;/a&gt;,
we were already serving paying customers via a complex codebase. A complete rewrite
was out of the question as we had contractual obligations, and we had to keep improving
the existing product in order to maintain the competitive edge; it became very clear
that we needed to maintain the existing codebase and refactor it incrementally.
&lt;/p&gt;
&lt;p&gt;
An additional data point was that our core team members were highly experienced with
Java development and quite comfortable with the platform; we also had a distinct preference
for statically typed languages, which ruled several alternatives (particularly Clojure)
right out. Scala seemed like a great compromise in that it allowed us to maintain
and extend the existing codebase while enjoying advanced language features and improved
veracity at little or no risk to the product itself.
&lt;/p&gt;
&lt;h3&gt;How should I "sell" Scala to my boss?
&lt;/h3&gt;
&lt;p&gt;
&lt;strong&gt;"Safe" choice with proven track record: &lt;/strong&gt;Scala is not an entirely
new language, and has reached a maturity tipping point at 2.8; over the last two years
the language has been gaining significant momentum, and has a number of strong advocates
and success stories, including Twitter, Foursquare, LinkedIn and a &lt;a href="http://www.quora.com/Startups/What-startups-or-tech-companies-are-using-Scala"&gt;whole
host of others&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Scala as a better Java:&lt;/strong&gt; You don't have to go all-in on Scala's advanced
feature set, but can instead think of Scala as an improved Java with type inference,
closures, advanced collection framework, traits and pattern matching; these features
alone will increase your developers' happiness by an order of magnitude, and productivity
will see a corresponding improvement. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Less code ⇒ less bugs&lt;/strong&gt;: Scala code is far more concise than corresponding
Java code, an helps the developer focus on the "what" instead of the "how". The resulting
code is usually much shorter, clearer and simpler, which in turn helps lower bug count.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Helps hire better engineers:&lt;/strong&gt; Great engineers not only love working
with the latest technologies, but also love practical, incremental improvements to
well-respected technologies. Merely saying "we use Scala" will help attract the sort
of seasoned, reliable and professional engineers that you most want to hire.
&lt;/p&gt;
&lt;h3&gt;Where does Scala put you at risk?
&lt;/h3&gt;
&lt;p&gt;
&lt;strong&gt;Learning curve:&lt;/strong&gt; Although Scala largely derives from Java, it's a
whole new language with a lot of features that takes time to master. Don't expect
your developers to be productive from day one; instead, provide opportunities for
experimentation and encourage iterative development (and yes, give your developers
time and mandate to throw away badly written early code and redo their work if necessary).
There is actually a lot of material on Scala and an active and vibrant community;
specifically, your developers can easily find help (and answers) on &lt;a href="http://www.stackoverflow.com"&gt;StackOverflow&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Rough edges: &lt;/strong&gt;Scala is fairly new, and consequently a lot of things
that you take for granted with Java are not as mature or robust with Scala. IDE support
is a moving target: Eclipse and IntelliJ IDEA both have actively developed Scala plugins
and both have occasional issues (spurious error highlighting, lackluster performance,
wonky debuggers). The common build tools support Scala, but don't play as nicely;
for example, only the native build tool (sbt) support incremental compilation. Even
the compiler itself is not entirely bug-free, although these are getting very rare
indeed. Bottom line: expect occasional problems, and be patient while working around
them; even better, &lt;strong&gt;encourage your engineers to participate in the community&lt;/strong&gt;,
file bugs and even offer patches where possible.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Production characteristics:&lt;/strong&gt; While it runs on the JVM, Scala is &lt;em&gt;not&lt;/em&gt; Java;
there are subtle differences that you should be aware of when maintaining large-scale
or highly-available software. Scala generates a great deal of synthetic code, which
puts additional pressure on the PermGen space; synthetic stack frames may also exhibit
significantly increased stack usage. Scala also creates a lot of intermediate objects
at runtime, which results in added eden generation churn. You may want to profile
your applications and tune the GC accordingly.
&lt;/p&gt;
&lt;h3&gt;What's the bottom line?
&lt;/h3&gt;
&lt;p&gt;
&lt;img style="display: block; margin-left: auto; margin-right: auto;" title="codebase-evolution.png" src="http://www.tomergabel.com/content/binary/codebase-evolution.png" alt="Codebase evolution" width="600" height="450" border="0" /&gt;
&lt;/p&gt;
&lt;p&gt;
Scala is fantastic. Our team at newBrandAnalytics is remarkably happier with Scala
despite the occasional hitches, and I doubt any of us will consider going back to
Java given the option. As long as you keep in mind that &lt;em&gt;on the bleeding edge you
may get cut&lt;/em&gt;, I definitely recommend taking the plunge, with contractors and die-hard
traditional enterprises the possible exceptions.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=b8d6056d-cdf8-49a7-ac8c-d4424a965720" /&gt;</description>
      <category>Development</category>
      <category>Development/Java</category>
    </item>
    <item>
      <trackback:ping>http://www.tomergabel.com/Trackback.aspx?guid=b849579e-4637-4051-ba21-f87975905ca0</trackback:ping>
      <pingback:server>http://www.tomergabel.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.tomergabel.com/PermaLink,guid,b849579e-4637-4051-ba21-f87975905ca0.aspx</pingback:target>
      <dc:creator>Tomer Gabel</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <em>Download </em>
          <a href="http://ant-intellij-tasks.googlecode.com/files/ant-intellij-tasks-1.0-b1.zip">
            <em>ant-intellij-tasks-1.0-b1.zip</em>
          </a>
          <em>
          </em>
        </p>
        <p>
A great but oft-ignored feature of Visual Studio 2005 and up is the inherent consolidation
of an important developer tool: the build system. With a Visual Studio solution you
can simply run MSBuild and you get accurate, automated builds. This is an invaluable
capability: continuous integration is ridiculously easy to set up, as are nightly
builds and automated deployment tools.
</p>
        <p>
Since I started working for Delver (<a href="http://www.tomergabel.com/LifeIsFullOfSurprises.aspx">now
Sears</a>) I’ve been switching back and forth between C# (2.0 and later 3.0) and Java
1.6, and though the ecosystems share many similarities there are also several glaring
differences. The first of these differences is that, in the Java world, it is perfectly
acceptable – even traditional – to maintain a dual project structure, one using the
IDE (usually Eclipse or IntelliJ IDEA) and one using one of the build tools (commonly
Ant or Maven). The build scripts need to be continuously synchronized with the project
structure, and output parity between the two separate build systems is almost unheard-of.
</p>
        <p>
Because I had been a complete Java newbie when I started, I had never had the time
to really sit down and set up a continuous integration server for our Java codebase,
a mistake I did not intent to repeat when Sears took over. The first item on my agenda
was to do away with the dual project structure; we originally used Eclipse, so I built
a custom Ant script (my first, actually) around <a href="http://ant4eclipse.sourceforge.net/">ant4eclipse</a> and
managed to come up with a semi-satisfactory solution. This also gave us invaluable
insight when it was time to revisit our IDE choice; the lackluster project structure
offered by Eclipse, along with firm positive comments on IntelliJ IDEA from several
team members, tipped the balance and led us to switch to the alternative IDE, while
also creating the necessity for a revamped build system can that work on top of the
IntelliJ IDEA project structure.
</p>
        <p>
Out of necessity, a project was born. <a href="http://code.google.com/p/ant-intellij-tasks/">ant-intellij-tasks</a> is
the result of several months of all-night itch-scratching on my part. While not directly
affiliated with the company, we’ve been dogfooding the project at Sears for over a
month now, and while there are certainly rough edges it finally seems stable enough
for release! From the project website:
</p>
        <blockquote style="padding-bottom: 5px; padding-left: 5px; padding-right: 5px; background: #ccc; padding-top: 5px">
          <p>
            <a href="http://code.google.com/p/ant-intellij-tasks">ant-intellij-tasks</a> is a
self-contained build system for IntelliJ IDEA projects based around <a href="http://ant.apache.org/">Apache
Ant</a>. In essence, ant-intellij-tasks comprises three components: 
</p>
          <ol>
            <li>
An Ant task library that can extract and resolve the IntelliJ IDEA project and module
files (.ipr and .iml respectively), and provides a set of tasks and conditions around
the project structure; 
</li>
            <li>
A common build script which provides the four major build targets for modules: clean,
build, test and package (see <a href="http://code.google.com/p/ant-intellij-tasks/#Quickstart_Guide">the
quickstart guide</a>); 
</li>
            <li>
A master build script which extends these targets to the entire project. 
</li>
          </ol>
          <p>
The build system is designed to be extensible (e.g. by adding targets), customizable
(e.g. by overriding a target's behavior for a specific module) and self contained
in that it's a drop-in solution that should not require any significant modifications
to the code base. 
</p>
          <p>
          </p>
          <p>
This project is fully open source (distributed under an Apache license) and hosted
at Google Code. Please report any bugs or issues on the project <a href="http://code.google.com/p/ant-intellij-tasks/issues/list">issue
tracker</a>. 
</p>
          <p>
          </p>
          <p>
ant-intellij-tasks makes use of, and redistributes, the <a href="http://ant-contrib.sourceforge.net/">ant-contrib</a> task
library. 
</p>
        </blockquote>
        <img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=b849579e-4637-4051-ba21-f87975905ca0" />
      </body>
      <title>Announcing ant-intellij-tasks</title>
      <guid isPermaLink="false">http://www.tomergabel.com/PermaLink,guid,b849579e-4637-4051-ba21-f87975905ca0.aspx</guid>
      <link>http://www.tomergabel.com/AnnouncingAntintellijtasks.aspx</link>
      <pubDate>Wed, 30 Sep 2009 06:18:58 GMT</pubDate>
      <description>&lt;p&gt;
&lt;em&gt;Download &lt;/em&gt;&lt;a href="http://ant-intellij-tasks.googlecode.com/files/ant-intellij-tasks-1.0-b1.zip"&gt;&lt;em&gt;ant-intellij-tasks-1.0-b1.zip&lt;/em&gt;&lt;/a&gt;&lt;em&gt; &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
A great but oft-ignored feature of Visual Studio 2005 and up is the inherent consolidation
of an important developer tool: the build system. With a Visual Studio solution you
can simply run MSBuild and you get accurate, automated builds. This is an invaluable
capability: continuous integration is ridiculously easy to set up, as are nightly
builds and automated deployment tools.
&lt;/p&gt;
&lt;p&gt;
Since I started working for Delver (&lt;a href="http://www.tomergabel.com/LifeIsFullOfSurprises.aspx"&gt;now
Sears&lt;/a&gt;) I’ve been switching back and forth between C# (2.0 and later 3.0) and Java
1.6, and though the ecosystems share many similarities there are also several glaring
differences. The first of these differences is that, in the Java world, it is perfectly
acceptable – even traditional – to maintain a dual project structure, one using the
IDE (usually Eclipse or IntelliJ IDEA) and one using one of the build tools (commonly
Ant or Maven). The build scripts need to be continuously synchronized with the project
structure, and output parity between the two separate build systems is almost unheard-of.
&lt;/p&gt;
&lt;p&gt;
Because I had been a complete Java newbie when I started, I had never had the time
to really sit down and set up a continuous integration server for our Java codebase,
a mistake I did not intent to repeat when Sears took over. The first item on my agenda
was to do away with the dual project structure; we originally used Eclipse, so I built
a custom Ant script (my first, actually) around &lt;a href="http://ant4eclipse.sourceforge.net/"&gt;ant4eclipse&lt;/a&gt; and
managed to come up with a semi-satisfactory solution. This also gave us invaluable
insight when it was time to revisit our IDE choice; the lackluster project structure
offered by Eclipse, along with firm positive comments on IntelliJ IDEA from several
team members, tipped the balance and led us to switch to the alternative IDE, while
also creating the necessity for a revamped build system can that work on top of the
IntelliJ IDEA project structure.
&lt;/p&gt;
&lt;p&gt;
Out of necessity, a project was born. &lt;a href="http://code.google.com/p/ant-intellij-tasks/"&gt;ant-intellij-tasks&lt;/a&gt; is
the result of several months of all-night itch-scratching on my part. While not directly
affiliated with the company, we’ve been dogfooding the project at Sears for over a
month now, and while there are certainly rough edges it finally seems stable enough
for release! From the project website:
&lt;/p&gt;
&lt;blockquote style="padding-bottom: 5px; padding-left: 5px; padding-right: 5px; background: #ccc; padding-top: 5px"&gt; 
&lt;p&gt;
&lt;a href="http://code.google.com/p/ant-intellij-tasks"&gt;ant-intellij-tasks&lt;/a&gt; is a
self-contained build system for IntelliJ IDEA projects based around &gt;&lt;a href="http://ant.apache.org/"&gt;Apache
Ant&lt;/a&gt;. In essence, ant-intellij-tasks comprises three components: 
&lt;ol&gt;
&lt;li&gt;
An Ant task library that can extract and resolve the IntelliJ IDEA project and module
files (.ipr and .iml respectively), and provides a set of tasks and conditions around
the project structure; 
&lt;li&gt;
A common build script which provides the four major build targets for modules: clean,
build, test and package (see &lt;a href="http://code.google.com/p/ant-intellij-tasks/#Quickstart_Guide"&gt;the
quickstart guide&lt;/a&gt;); 
&lt;li&gt;
A master build script which extends these targets to the entire project. 
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
The build system is designed to be extensible (e.g. by adding targets), customizable
(e.g. by overriding a target's behavior for a specific module) and self contained
in that it's a drop-in solution that should not require any significant modifications
to the code base. 
&lt;p&gt;
&lt;p&gt;
This project is fully open source (distributed under an Apache license) and hosted
at Google Code. Please report any bugs or issues on the project &lt;a href="http://code.google.com/p/ant-intellij-tasks/issues/list"&gt;issue
tracker&lt;/a&gt;. 
&lt;p&gt;
&lt;p&gt;
ant-intellij-tasks makes use of, and redistributes, the &lt;a href="http://ant-contrib.sourceforge.net/"&gt;ant-contrib&lt;/a&gt; task
library. 
&lt;/p&gt;
&lt;/blockquote&gt;&lt;img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=b849579e-4637-4051-ba21-f87975905ca0" /&gt;</description>
      <category>Development</category>
      <category>Development/Java</category>
      <category>Software</category>
      <category>ant-intellij-tasks</category>
    </item>
    <item>
      <trackback:ping>http://www.tomergabel.com/Trackback.aspx?guid=6a6c2dc7-df2a-4bec-8a2b-0e7d1e652d3f</trackback:ping>
      <pingback:server>http://www.tomergabel.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.tomergabel.com/PermaLink,guid,6a6c2dc7-df2a-4bec-8a2b-0e7d1e652d3f.aspx</pingback:target>
      <dc:creator>Tomer Gabel</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Apparently Java has quite a few known but practically undocumented issues with its
handling of UNC paths under Windows. I’ve specifically encountered <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5086147">this
bug</a> albeit in a slightly different scenario:
</p>
        <div>
          <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">@Test<br /><span style="color: #0000ff">public</span><span style="color: #0000ff">void</span> test() <span style="color: #0000ff">throws</span> URISyntaxException
{<br /><span style="color: #0000ff">final</span> URI uri = <span style="color: #0000ff">new</span> URI( <span style="color: #006080">"file://c:/temp/test/ham.and.eggs"</span> );<br /><span style="color: #0000ff">new</span> File( uri ); <span style="color: #008000">//
IllegalArgumentException thrown here</span><br />
}</pre>
        </div>
        <div>
          <br />
Apparently the two slashes after file: are misinterpreted as the authority part of
the URI; <a href="http://stackoverflow.com/questions/1131273/java-file-touri-tourl-on-windows-file/1131465#1131465">this
thread</a> on StackOverflow may give a few starting points if want to delve deeper.
It seems Java implements an older RFC for URIs which has slightly different tokenization
rules.
</div>
        <div> 
</div>
        <div>At any rate, so far the only sensible solution I’ve managed to come with is to
manually remove or add (depending on your tastes…) a slash:
</div>
        <div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
          <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
            <p>
              <span style="color: #008000">/**</span>
              <br />
              <span style="color: #008000"> * Resolves the specified URI, and returns the file </span>
              <br />
              <span style="color: #008000"> * represented by the URI.</span>
              <br />
              <span style="color: #008000"> *</span>
              <br />
              <span style="color: #008000"> * @param uri The URI for which to return an absolute
path.</span>
              <br />
              <span style="color: #008000"> * @return The {@link File} instance represented by the</span>
              <br />
              <span style="color: #008000"> * specified URI.</span>
              <br />
              <span style="color: #008000"> * @throws IllegalArgumentException &lt;ul&gt;&lt;li&gt;The
URI cannot </span>
              <br />
              <span style="color: #008000"> * be null.&lt;/li&gt;&lt;li&gt;Wrong URI scheme for
path resolution;</span>
              <br />
              <span style="color: #008000"> * only file:// URIs are supported.&lt;/li&gt;&lt;/ul&gt;</span>
              <br />
              <span style="color: #008000"> */</span>
              <br />
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span> File
getFile( URI uri )<br /><span style="color: #0000ff">throws</span> IllegalArgumentException {<br /><span style="color: #0000ff">if</span> ( uri == null )<br /><span style="color: #0000ff">throw</span><span style="color: #0000ff">new</span> IllegalArgumentException(<br /><span style="color: #006080">"The URI cannot be null."</span> );
</p>
            <p>
              <br />
              <br />
              <span style="color: #0000ff">if</span> ( !<span style="color: #006080">"file"</span>.equals(
uri.getScheme() ) )<br /><span style="color: #0000ff">throw</span><span style="color: #0000ff">new</span> IllegalArgumentException( <span style="color: #006080">"Wrong
URI "</span> + 
<br /><span style="color: #006080">"scheme for path resolution, expected \"file\" "</span> +<br /><span style="color: #006080">"and got \""</span> + uri.getScheme() + <span style="color: #006080">"\""</span> );
</p>
            <p>
              <br />
              <span style="color: #008000">// Workaround for the following bug: </span>
              <br />
              <span style="color: #008000">// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5086147</span>
              <br />
              <span style="color: #008000">// Remove extra slashes after the scheme part.</span>
              <br />
              <span style="color: #0000ff">if</span> ( uri.getAuthority() != null )<br /><span style="color: #0000ff">try</span> {<br />
uri = <span style="color: #0000ff">new</span> URI( uri.toString().replace( 
<br /><span style="color: #006080">"file://"</span>, <span style="color: #006080">"file:/"</span> )
);<br />
} <span style="color: #0000ff">catch</span> ( URISyntaxException e ) {<br /><span style="color: #0000ff">throw</span><span style="color: #0000ff">new</span> IllegalArgumentException( <span style="color: #006080">"The
specified "</span> +<br /><span style="color: #006080">"URI contains an authority, but could not be "</span> +<br /><span style="color: #006080">"normalized."</span>, e );<br />
}
</p>
            <p>
              <br />
              <br />
              <span style="color: #0000ff">return</span>
              <span style="color: #0000ff">new</span> File(
uri );<br />
}<br /></p>
          </pre>
          <br />
        </div>
        <div> 
</div>
        <div>This is definitely a workaround, but according to newsgroup and forum posts these
bugs have been around forever. If anyone has a more elegant solution I’d love to know.
</div>
        <img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=6a6c2dc7-df2a-4bec-8a2b-0e7d1e652d3f" />
      </body>
      <title>Java mishandles UNC paths on Windows</title>
      <guid isPermaLink="false">http://www.tomergabel.com/PermaLink,guid,6a6c2dc7-df2a-4bec-8a2b-0e7d1e652d3f.aspx</guid>
      <link>http://www.tomergabel.com/JavaMishandlesUNCPathsOnWindows.aspx</link>
      <pubDate>Mon, 03 Aug 2009 05:00:20 GMT</pubDate>
      <description>&lt;p&gt;
Apparently Java has quite a few known but practically undocumented issues with its
handling of UNC paths under Windows. I’ve specifically encountered &lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5086147"&gt;this
bug&lt;/a&gt; albeit in a slightly different scenario:
&lt;/p&gt;
&lt;div&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;@Test&lt;br&gt;
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; test() &lt;span style="color: #0000ff"&gt;throws&lt;/span&gt; URISyntaxException
{&lt;br&gt;
&lt;span style="color: #0000ff"&gt;final&lt;/span&gt; URI uri = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; URI( &lt;span style="color: #006080"&gt;"file://c:/temp/test/ham.and.eggs"&lt;/span&gt; );&lt;br&gt;
&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; File( uri ); &lt;span style="color: #008000"&gt;//
IllegalArgumentException thrown here&lt;/span&gt;
&lt;br&gt;
}&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br&gt;
Apparently the two slashes after file: are misinterpreted as the authority part of
the URI; &lt;a href="http://stackoverflow.com/questions/1131273/java-file-touri-tourl-on-windows-file/1131465#1131465"&gt;this
thread&lt;/a&gt; on StackOverflow may give a few starting points if want to delve deeper.
It seems Java implements an older RFC for URIs which has slightly different tokenization
rules.
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;At any rate, so far the only sensible solution I’ve managed to come with is to
manually remove or add (depending on your tastes…) a slash:
&lt;/div&gt;
&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
&lt;p&gt;
&lt;span style="color: #008000"&gt;/**&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt; * Resolves the specified URI, and returns the file &lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt; * represented by the URI.&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt; *&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt; * @param uri The URI for which to return an absolute
path.&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt; * @return The {@link File} instance represented by the&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt; * specified URI.&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt; * @throws IllegalArgumentException &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;The
URI cannot &lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt; * be null.&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;Wrong URI scheme for
path resolution;&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt; * only file:// URIs are supported.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt; */&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; File
getFile( URI uri )&lt;br&gt;
&lt;span style="color: #0000ff"&gt;throws&lt;/span&gt; IllegalArgumentException {&lt;br&gt;
&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ( uri == null )&lt;br&gt;
&lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; IllegalArgumentException(&lt;br&gt;
&lt;span style="color: #006080"&gt;"The URI cannot be null."&lt;/span&gt; );
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ( !&lt;span style="color: #006080"&gt;"file"&lt;/span&gt;.equals(
uri.getScheme() ) )&lt;br&gt;
&lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; IllegalArgumentException( &lt;span style="color: #006080"&gt;"Wrong
URI "&lt;/span&gt; + 
&lt;br&gt;
&lt;span style="color: #006080"&gt;"scheme for path resolution, expected \"file\" "&lt;/span&gt; +&lt;br&gt;
&lt;span style="color: #006080"&gt;"and got \""&lt;/span&gt; + uri.getScheme() + &lt;span style="color: #006080"&gt;"\""&lt;/span&gt; );
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt;// Workaround for the following bug: &lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt;// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5086147&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #008000"&gt;// Remove extra slashes after the scheme part.&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ( uri.getAuthority() != null )&lt;br&gt;
&lt;span style="color: #0000ff"&gt;try&lt;/span&gt; {&lt;br&gt;
uri = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; URI( uri.toString().replace( 
&lt;br&gt;
&lt;span style="color: #006080"&gt;"file://"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"file:/"&lt;/span&gt; )
);&lt;br&gt;
} &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; ( URISyntaxException e ) {&lt;br&gt;
&lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; IllegalArgumentException( &lt;span style="color: #006080"&gt;"The
specified "&lt;/span&gt; +&lt;br&gt;
&lt;span style="color: #006080"&gt;"URI contains an authority, but could not be "&lt;/span&gt; +&lt;br&gt;
&lt;span style="color: #006080"&gt;"normalized."&lt;/span&gt;, e );&lt;br&gt;
}
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; File(
uri );&lt;br&gt;
}&lt;br&gt;
&lt;/p&gt;
&lt;/pre&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;This is definitely a workaround, but according to newsgroup and forum posts these
bugs have been around forever. If anyone has a more elegant solution I’d love to know.
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=6a6c2dc7-df2a-4bec-8a2b-0e7d1e652d3f" /&gt;</description>
      <category>Development</category>
      <category>Development/Java</category>
    </item>
    <item>
      <trackback:ping>http://www.tomergabel.com/Trackback.aspx?guid=eae0e740-85ac-40ce-b924-2c126bfa7471</trackback:ping>
      <pingback:server>http://www.tomergabel.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.tomergabel.com/PermaLink,guid,eae0e740-85ac-40ce-b924-2c126bfa7471.aspx</pingback:target>
      <dc:creator>Tomer Gabel</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Because the Java language lacks delegates, anonymous classes are prevalent as a syntactic
replacement. Non-static nested classes are also often used in the language, a feature
which is conspicuously absent from C#, albeit far less necessary with that language.
</p>
        <p>
This brings me to the following language caveat. This may seem a contrived example,
but it's a simplification of an actual issue I've encountered in the last few days.
Suppose you have a generic base class, call it <tt>BaseClass&lt;U&gt;</tt>, which
you extend with an anonymous class. Lets also assume that the extended class spawns
a thread that needs to access the <tt>BaseClass&lt;U&gt;</tt> state:
</p>
        <blockquote>
          <pre>
            <span style="color: #0000ff">class</span> BaseClass&lt;U&gt; { <span style="color: #0000ff">void</span> getState()
{} } <span style="color: #0000ff">class</span> Test { <span style="color: #0000ff">public</span><span style="color: #0000ff">void</span> test()
{ <span style="color: #0000ff">final</span> BaseClass&lt;String&gt; instance = <span style="color: #0000ff">new</span> BaseClass&lt;String&gt;()
{ <span style="color: #0000ff">public</span><span style="color: #0000ff">void</span> invokeStatefulThread()
{ <span style="color: #008000">// Create our runnable</span><span style="color: #0000ff">final</span> Runnable
threadCode = <span style="color: #0000ff">new</span> Runnable() { <span style="color: #0000ff">public</span><span style="color: #0000ff">void</span> run()
{ <span style="color: #008000">/* 1 */</span> getState(); <span style="color: #008000">/*
2 */</span><span style="color: #0000ff">this</span>.getState(); <span style="color: #008000">/*
3 */</span><span style="color: #0000ff">super</span>.getState(); <span style="color: #008000">/*
4 */</span> BaseClass.<span style="color: #0000ff">this</span>.getState(); <span style="color: #008000">/*
5 */</span> BaseClass&lt;String&gt;.<span style="color: #0000ff">this</span>.getState();
} }; <span style="color: #0000ff">new</span> Thread( threadCode ).start(); } }; instance.invokeStatefulThread();
} }</pre>
        </blockquote>
        <p>
I'll spare you the guessing game. Here's what happens with each of the five invocations
of <tt>getState()</tt>:
</p>
        <ol>
          <li>
Compiles and behaves as expected. 
</li>
          <li>
Obviously won't compile; <tt>this</tt> points to the <tt>Runnable</tt>. 
</li>
          <li>
Obviously won't compile; the superclass of a <tt>Runnable</tt> is <tt>Object</tt>. 
</li>
          <li>
Although this is the correct raw class, it won't compile because <tt>"No enclosing
instance of the type BaseClass&lt;U&gt; is accessible in scope"</tt>, even though
the raw type should still be accessible and <tt>U</tt> can be inferred. 
</li>
          <li>
Although this appears to be the correct fully-qualified form, this does not compile
with a <tt>"Syntax error on token(s), misplaced construct(s)"</tt> error.</li>
        </ol>
        <p>
The Java language specification section on "<a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.8.4">qualified <tt>this</tt></a>"
is very brief and does not mention generics at all (does "class name" include bounded
type parameters?). Oddly enough, moving the class declaration outside of the test
method actually lets 4 compile -- if there's a clue there, I haven't figured it out
yet.
</p>
        <p>
I still haven't found a syntactically-correct way to access <tt>BaseClass&lt;string&gt;.this</tt>,
other than placing it in a temporary variable outside of the <tt>Runnable</tt> declaration.
I searched yesterday for a couple of hours with no obvious solution in sight. Ideas
are more than welcome!...
</p>
        <img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=eae0e740-85ac-40ce-b924-2c126bfa7471" />
      </body>
      <title>Java &amp;quot;qualified this&amp;quot; with generic enclosing types</title>
      <guid isPermaLink="false">http://www.tomergabel.com/PermaLink,guid,eae0e740-85ac-40ce-b924-2c126bfa7471.aspx</guid>
      <link>http://www.tomergabel.com/JavaQuotqualifiedThisquotWithGenericEnclosingTypes.aspx</link>
      <pubDate>Tue, 22 Jul 2008 08:27:45 GMT</pubDate>
      <description>&lt;p&gt;
Because the Java language lacks delegates, anonymous classes are prevalent as a syntactic
replacement. Non-static nested classes are also often used in the language, a feature
which is conspicuously absent from C#, albeit far less necessary with that language.
&lt;/p&gt;
&lt;p&gt;
This brings me to the following language caveat. This may seem a contrived example,
but it's a simplification of an actual issue I've encountered in the last few days.
Suppose you have a generic base class, call it &lt;tt&gt;BaseClass&amp;lt;U&amp;gt;&lt;/tt&gt;, which
you extend with an anonymous class. Lets also assume that the extended class spawns
a thread that needs to access the &lt;tt&gt;BaseClass&amp;lt;U&amp;gt;&lt;/tt&gt; state:
&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;&lt;span style="color: #0000ff"&gt;class&lt;/span&gt; BaseClass&amp;lt;U&amp;gt; { &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; getState()
{} } &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Test { &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; test()
{ &lt;span style="color: #0000ff"&gt;final&lt;/span&gt; BaseClass&amp;lt;String&amp;gt; instance = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BaseClass&amp;lt;String&amp;gt;()
{ &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; invokeStatefulThread()
{ &lt;span style="color: #008000"&gt;// Create our runnable&lt;/span&gt; &lt;span style="color: #0000ff"&gt;final&lt;/span&gt; Runnable
threadCode = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Runnable() { &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; run()
{ &lt;span style="color: #008000"&gt;/* 1 */&lt;/span&gt; getState(); &lt;span style="color: #008000"&gt;/*
2 */&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.getState(); &lt;span style="color: #008000"&gt;/*
3 */&lt;/span&gt; &lt;span style="color: #0000ff"&gt;super&lt;/span&gt;.getState(); &lt;span style="color: #008000"&gt;/*
4 */&lt;/span&gt; BaseClass.&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.getState(); &lt;span style="color: #008000"&gt;/*
5 */&lt;/span&gt; BaseClass&amp;lt;String&amp;gt;.&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.getState();
} }; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Thread( threadCode ).start(); } }; instance.invokeStatefulThread();
} }&lt;/pre&gt;&lt;/blockquote&gt; 
&lt;p&gt;
I'll spare you the guessing game. Here's what happens with each of the five invocations
of &lt;tt&gt;getState()&lt;/tt&gt;:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Compiles and behaves as expected. 
&lt;li&gt;
Obviously won't compile; &lt;tt&gt;this&lt;/tt&gt; points to the &lt;tt&gt;Runnable&lt;/tt&gt;. 
&lt;li&gt;
Obviously won't compile; the superclass of a &lt;tt&gt;Runnable&lt;/tt&gt; is &lt;tt&gt;Object&lt;/tt&gt;. 
&lt;li&gt;
Although this is the correct raw class, it won't compile because &lt;tt&gt;"No enclosing
instance of the type BaseClass&amp;lt;U&amp;gt; is accessible in scope"&lt;/tt&gt;, even though
the raw type should still be accessible and &lt;tt&gt;U&lt;/tt&gt; can be inferred. 
&lt;li&gt;
Although this appears to be the correct fully-qualified form, this does not compile
with a &lt;tt&gt;"Syntax error on token(s), misplaced construct(s)"&lt;/tt&gt; error.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
The Java language specification section on "&lt;a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.8.4"&gt;qualified &lt;tt&gt;this&lt;/tt&gt;&lt;/a&gt;"
is very brief and does not mention generics at all (does "class name" include bounded
type parameters?). Oddly enough, moving the class declaration outside of the test
method actually lets 4 compile -- if there's a clue there, I haven't figured it out
yet.
&lt;/p&gt;
&lt;p&gt;
I still haven't found a syntactically-correct way to access &lt;tt&gt;BaseClass&amp;lt;string&amp;gt;.this&lt;/tt&gt;,
other than placing it in a temporary variable outside of the &lt;tt&gt;Runnable&lt;/tt&gt; declaration.
I searched yesterday for a couple of hours with no obvious solution in sight. Ideas
are more than welcome!...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=eae0e740-85ac-40ce-b924-2c126bfa7471" /&gt;</description>
      <category>Development</category>
      <category>Development/Java</category>
    </item>
    <item>
      <trackback:ping>http://www.tomergabel.com/Trackback.aspx?guid=b657662e-31b1-4eb3-bfd4-2557b2ff78b0</trackback:ping>
      <pingback:server>http://www.tomergabel.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.tomergabel.com/PermaLink,guid,b657662e-31b1-4eb3-bfd4-2557b2ff78b0.aspx</pingback:target>
      <dc:creator>Tomer Gabel</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The Java implementation for generics is radically different from the C# equivalent;
I won't reiterate issues that have been <a href="http://www.itu.dk/courses/PFOO/F2006/diku-javacsharpgenerics.pdf">thoroughly
discussed before</a>, but suffice to say that Java generics are implemented as a backwards-compatible
compiler extension that works on unmodified VMs.
</p>
        <p>
The implications of this are considerable, and I'd like to present one of them. Lets
fast forward a bit and consider a relatively new language feature in Java (introduced,
I believe, with J2SE 5.0): autoboxing. A thoroughly overdue language feature, autoboxing
allows the seamless transition from regular value types (e.g. the ubiquitous <span class="codetext">int</span>)
to object references (<span class="codetext">Integer</span>); before autoboxing you
couldn't simply add a value to an untyped ArrayList, you had to box (wrap) it in a
reference type:
</p>
        <blockquote>
          <pre>ArrayList list = <span style="color: #0000ff">new</span> ArrayList();
list.add( 3 ); <span style="color: #008000">// Compile-time error</span> list.add( <span style="color: #0000ff">new</span> Integer(
3 ) ); <span style="color: #008000">// OK</span></pre>
        </blockquote>
        <p>
Eventually Java caught up with C# (which introduced autoboxing in 2002), and with
a modern compiler the above code would be valid.
</p>
        <p>
With the introductions out of the way, here's a pop-quiz: what does the following
code print?
</p>
        <blockquote>
          <pre>HashMap&lt;Integer, Integer&gt; map = <span style="color: #0000ff">new</span> HashMap&lt;Integer,
Integer&gt;(); map.put( 4, 2 ); <span style="color: #0000ff">short</span> n = 4; System.out.println(
Integer.toString( map.get( n ) ) );</pre>
        </blockquote>
        <p>
As a long-time C# programmer I was completely befuddled when the code resulted in
a <span class="codetext">NullPointerException</span>. Huh? Exception? What? Why?
</p>
        <p>
It took me a while to figure it out: because Java generics are compile-time constructs
and are not directly supported by the VM, what actually happens is that the underlying
container class accepts regular <span class="codetext">Object</span> instances (reference
types); the compile-time check merely asserts that <span class="codetext">n</span> can
be promoted from <span class="codetext">short</span> to <span class="codetext">int</span>,
whereas the actual object passed to the container class (via autoboxing) is a <span class="codetext">Short</span>!
Since the container doesn't doesn't actually have a runtime generic <em>type</em> per
se, the collection merely looks up the reference object in the map, fails to find
it (I guess the <span class="codetext">Object.hashCode</span> implementation for value
types simply returns the reference value as the hash code as in C#) and returns <span class="codetext">null</span>.
Doh! <b>*slaps forehead*</b></p>
        <img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=b657662e-31b1-4eb3-bfd4-2557b2ff78b0" />
      </body>
      <title>Java language caveat: autoboxing and generics</title>
      <guid isPermaLink="false">http://www.tomergabel.com/PermaLink,guid,b657662e-31b1-4eb3-bfd4-2557b2ff78b0.aspx</guid>
      <link>http://www.tomergabel.com/JavaLanguageCaveatAutoboxingAndGenerics.aspx</link>
      <pubDate>Sun, 06 Jan 2008 17:15:54 GMT</pubDate>
      <description>&lt;p&gt;
The Java implementation for generics is radically different from the C# equivalent;
I won't reiterate issues that have been &lt;a href="http://www.itu.dk/courses/PFOO/F2006/diku-javacsharpgenerics.pdf"&gt;thoroughly
discussed before&lt;/a&gt;, but suffice to say that Java generics are implemented as a backwards-compatible
compiler extension that works on unmodified VMs.
&lt;/p&gt;
&lt;p&gt;
The implications of this are considerable, and I'd like to present one of them. Lets
fast forward a bit and consider a relatively new language feature in Java (introduced,
I believe, with J2SE 5.0): autoboxing. A thoroughly overdue language feature, autoboxing
allows the seamless transition from regular value types (e.g. the ubiquitous &lt;span class="codetext"&gt;int&lt;/span&gt;)
to object references (&lt;span class="codetext"&gt;Integer&lt;/span&gt;); before autoboxing you
couldn't simply add a value to an untyped ArrayList, you had to box (wrap) it in a
reference type:
&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;ArrayList list = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArrayList();
list.add( 3 ); &lt;span style="color: #008000"&gt;// Compile-time error&lt;/span&gt; list.add( &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Integer(
3 ) ); &lt;span style="color: #008000"&gt;// OK&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt; 
&lt;p&gt;
Eventually Java caught up with C# (which introduced autoboxing in 2002), and with
a modern compiler the above code would be valid.
&lt;/p&gt;
&lt;p&gt;
With the introductions out of the way, here's a pop-quiz: what does the following
code print?
&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;HashMap&amp;lt;Integer, Integer&amp;gt; map = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; HashMap&amp;lt;Integer,
Integer&amp;gt;(); map.put( 4, 2 ); &lt;span style="color: #0000ff"&gt;short&lt;/span&gt; n = 4; System.out.println(
Integer.toString( map.get( n ) ) );&lt;/pre&gt;&lt;/blockquote&gt; 
&lt;p&gt;
As a long-time C# programmer I was completely befuddled when the code resulted in
a &lt;span class="codetext"&gt;NullPointerException&lt;/span&gt;. Huh? Exception? What? Why?
&lt;/p&gt;
&lt;p&gt;
It took me a while to figure it out: because Java generics are compile-time constructs
and are not directly supported by the VM, what actually happens is that the underlying
container class accepts regular &lt;span class="codetext"&gt;Object&lt;/span&gt; instances (reference
types); the compile-time check merely asserts that &lt;span class="codetext"&gt;n&lt;/span&gt; can
be promoted from &lt;span class="codetext"&gt;short&lt;/span&gt; to &lt;span class="codetext"&gt;int&lt;/span&gt;,
whereas the actual object passed to the container class (via autoboxing) is a &lt;span class="codetext"&gt;Short&lt;/span&gt;!
Since the container doesn't doesn't actually have a runtime generic &lt;em&gt;type&lt;/em&gt; per
se, the collection merely looks up the reference object in the map, fails to find
it (I guess the &lt;span class="codetext"&gt;Object.hashCode&lt;/span&gt; implementation for value
types simply returns the reference value as the hash code as in C#) and returns &lt;span class="codetext"&gt;null&lt;/span&gt;.
Doh! &lt;b&gt;*slaps forehead*&lt;/b&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=b657662e-31b1-4eb3-bfd4-2557b2ff78b0" /&gt;</description>
      <category>Development</category>
      <category>Development/Java</category>
    </item>
    <item>
      <trackback:ping>http://www.tomergabel.com/Trackback.aspx?guid=08ee53ca-6d1a-4406-a7c4-579f6414db2a</trackback:ping>
      <pingback:server>http://www.tomergabel.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.tomergabel.com/PermaLink,guid,08ee53ca-6d1a-4406-a7c4-579f6414db2a.aspx</pingback:target>
      <dc:creator>Tomer Gabel</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
So you want a web project, a build system and a reasonable IDE to take care of the
annoying details for you, right? The good news are that it's actually quite possible
and there're many ways to do this. The bad news are that it's nigh impossible to get
them to play along if you don't already know how to do that. It took me days to find
a solution that finally seems to work, and I'd like to share it with you. I'm probably
missing a few important details or did something really really stupid along the way
(I'd appreciate comments!), but this process does seem to work. <strong>I'm not going
into essentials of Java-based web development here</strong> -- if you want a more
basic explanation of the terminology, post a comment and I'll see what I can do...
</p>
        <p>
          <u>1. Goal</u>
        </p>
        <p>
I want to:
</p>
        <ul>
          <li>
Use a common, standard and powerful IDE to edit and debug my Java code, and preferably
provide a usable GUI interface for dependency and project management; 
</li>
          <li>
Use a common, standard servlet container to host my servlet and still be able to control
and debug everything from the same IDE; 
</li>
          <li>
Have a convenient way to handle internal-and-external dependencies without worrying
too much about the details; 
</li>
          <li>
Be able to quickly compile, test and package my servlet for deployment; 
</li>
          <li>
            <em>
              <strong>Understand as little as possible about the dependency stack of the tools
involved</strong>
            </em>
          </li>
        </ul>
        <p>
I'm going to tell you how to achieve most of these goals, with two glaring omissions:
I won't show you how to do testing (I haven't successfully managed servlet unit testing
so far -- different post on that) and I can't help but delve into some of the more
annoying details involved with these tools and their dependencies. Sorry about that.
Additionally, some of the information here applies even if you use different tools,
but you're bound to face issues not covered here; don't assume I know more than you
do -- seek the answers, post them somewhere, and maybe the next person will actually
find what they're looking for!
</p>
        <p>
          <u>2. Tools</u>
        </p>
        <p>
The tools used are:
</p>
        <ul>
          <li>
            <a href="http://java.sun.com/javase/downloads/index.jsp">J2SE JDK</a> is an obvious
must-have. Version used: JDK 6 update 3; 
</li>
          <li>
            <a href="http://www.eclipse.org/">Eclipse</a> (but please don't download it just yet)
for code editing, debugging and project management; 
</li>
          <li>
            <a href="http://www.eclipse.org/webtools/">Web Tools Platform</a>: this is the Eclipse
plug-in that adds web development capabilities to the IDE, including J2EE dependency
management, hosting and running servlets from within the Eclipse workspace etc. This
would be a good time to run along to the <a href="http://download.eclipse.org/webtools/downloads/">WTP
web-site</a> and download the Web Tools Platform All-In-One package. I only used the
release version (2.0.1 at the time of writing this), so if you use another version
your mileage may vary; 
</li>
          <li>
            <a href="http://maven.apache.org/">Apache Maven</a> is the newfangled build system
from Apache slated to replace <a href="http://ant.apache.org/">ant</a>. I've used
it for the last few days and so far it appears to be quite robust and even fairly
well-integrated into Eclipse (see next item). Version used: 2.0.8; 
</li>
          <li>
            <a href="http://m2eclipse.codehaus.org/">M2eclipse</a> is the Eclipse plug-in for
Maven integration. I've only found one problem with it so far, which I'll detail later
on; 
</li>
          <li>
            <a href="http://tomcat.apache.org/">Apache Tomcat</a> is a solid choice in servlet
containers. It's robust, fast and open-source, and has terrific Eclipse integration.
I haven't given any of the other containers a serious whirl yet though.</li>
        </ul>
        <p>
          <u>3. Preparations</u>
        </p>
        <p>
Unlike Visual Studio, with the tools mentioned above there's no straightforward installation
procedure. You'll have to designate at least a workspace directory (where your Eclipse
projects, settings etc. go) and some location where the tools themselves go. For me,
it's C:\Dev\Eclipse and C:\Tools respectively.
</p>
        <ul>
          <li>
Setting up Java: 
<ul><li>
Install the JDK and remember where it was installed (nominally in <span class="codetext">%PROGRAMFILES%\Java\jdk1.6.0_03</span>) 
</li><li>
Set up a system-wide <span class="codetext">JAVA_HOME</span> environment variable
pointing to the same directory</li></ul></li>
          <li>
Setting up Maven and Tomcat: 
<ul><li>
Extract both archives to your designated directory (e.g. for Maven it would be <span class="codetext">C:\Tools\apache-maven-2.0.8</span>) 
</li><li>
Add the Maven bin directory to your <span class="codetext">PATH</span> environment
variable (user- or system-wide, depending on your preference) 
</li><li>
Add whichever J2EE libraries you desire from the Tomcat installation to your class-path.
If you have no idea what I'm talking about, you'll probably just want to set the <span class="codetext">CLASSPATH</span> environment
variable to your equivalent of <span class="codetext">c:\tools\apache-tomcat-6.0.14\lib\servlet-api.jar;c:\tools\apache-tomcat-6.0.14\lib\jsp-api.jar</span></li></ul></li>
          <li>
Setting up Eclipse: 
<ul><li>
Extract the WTP all-in-one package (which contains Eclipse itself) to your designated
directory (e.g. <span class="codetext">C:\Tools\Eclipse</span>) 
</li><li>
Load Eclipse and point it to your designated workspace location 
</li><li>
Install M2Eclipse: 
<ul><li>
Go to Help-&gt;Software Updates-&gt;Find and Install..., select "Search for new features
to install" and click Next 
</li><li>
Click on New Remote Site..., use M2eclipse or whatever for the name and <a title="http://m2eclipse.codehaus.org/update/" href="http://m2eclipse.codehaus.org/update/">http://m2eclipse.codehaus.org/update/</a> for
the URL 
</li><li>
Click on Finish and let Eclipse install the M2Eclipse plug-in</li></ul></li><li>
Set up a web server runtime for Eclipse to host your servlets in: 
<ul><li>
Open Window-&gt;Preferences... 
</li><li>
Under Server select Installed Runtimes and click on Add... 
</li><li>
Choose (from Apache) the Apache Tomcat v6.0 runtime and click Next 
</li><li>
Enter the Apache installation directory (e.g. <span class="codetext">C:\Tools\apache-tomcat-6.0.14</span>)
in the appropriate location and click Finish</li></ul></li></ul></li>
        </ul>
        <p>
          <u>4. Creating a new web project</u>
        </p>
        <p>
First off, you must create the actual project, directory structure etc. To do this:
</p>
        <ul>
          <li>
Open a command prompt, go to your Eclipse workspace directory 
</li>
          <li>
Decide on your Maven group and artifact IDs; it's worth noting that the artifact ID
is also the directory name for the project 
</li>
          <li>
Type in <span class="codetext">mvn archetype:create -DgroupId=<strong>your.group.id</strong> -DartifactId=<strong>your.artifact.id</strong> -DarchetypeArtifactId=maven-archetype-webapp </span></li>
          <li>
You'll notice that a new directory was created under the workspace root 
</li>
          <li>
Edit the Maven project descriptor <span class="codetext">POM.XML</span> in the newly
created directory: 
<ul><li>
Add (after the <span class="codetext">&lt;url&gt;</span> tag, although I'm not sure
the order matters) the following section: <blockquote style="font-family: monospace">&lt;profiles&gt;<br />
    &lt;profile&gt;<br />
        &lt;id&gt;servlet&lt;/id&gt;<br />
        &lt;activation&gt;<br />
            &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;<br />
        &lt;/activation&gt;<br />
        &lt;dependencies&gt;<br />
            &lt;dependency&gt;<br />
               
&lt;groupId&gt;javax.servlet&lt;/groupId&gt;<br />
               
&lt;artifactId&gt;servlet-api&lt;/artifactId&gt;<br />
               
&lt;version&gt;2.5&lt;/version&gt;<br />
               
&lt;scope&gt;provided&lt;/scope&gt;<br />
            &lt;/dependency&gt;<br />
            &lt;dependency&gt;<br />
               
&lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;<br />
               
&lt;artifactId&gt;jsp-api&lt;/artifactId&gt;<br />
               
&lt;version&gt;2.1&lt;/version&gt;<br />
               
&lt;scope&gt;provided&lt;/scope&gt;<br />
            &lt;/dependency&gt;<br />
        &lt;/dependencies&gt;<br />
    &lt;/profile&gt;<br />
&lt;/profiles&gt; </blockquote></li><li>
Under <span class="codetext">&lt;build&gt;</span>, add the following section: <blockquote style="font-family: monospace">&lt;plugins&gt;<br />
    &lt;plugin&gt;<br />
        &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;<br />
        &lt;artifactId&gt;maven-jetty-plugin&lt;/artifactId&gt;<br />
    &lt;/plugin&gt;<br />
    &lt;plugin&gt;<br />
        &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;<br />
        &lt;configuration&gt;<br />
            &lt;source&gt;1.5&lt;/source&gt;<br />
            &lt;target&gt;1.5&lt;/target&gt;<br />
        &lt;/configuration&gt;<br />
    &lt;/plugin&gt;<br />
&lt;/plugins&gt;</blockquote></li></ul></li>
          <li>
You can now thank my colleague <a href="http://www.aviransplace.com/">Aviran Mordo</a> for
finding out this bit of Voodoo. :-) 
</li>
          <li>
In the command prompt, now enter the project directory 
</li>
          <li>
Type in <span class="codetext">mvn eclipse:m2eclipse -Dwtpversion=1.5</span> to create
an Eclipse project 
</li>
          <li>
Run Eclipse if it's not already started, then from the package explorer right click
anywhere and click on Import... 
</li>
          <li>
Choose General-&gt;Existing Projects into Workspace. For root directory pick the workspace
directory 
</li>
          <li>
Choose the new project and click on Finish 
</li>
          <li>
At this point you may encounter a "Java compiler level does not match the version
of the installed Java project facet" error. If that's the case, just right-click on
the error (in the Problems view) and select Quick Fix, which will allow you to change
the Java project facet version to 6.0. If this isn't what you want, you probably know
enough to resolve the issue on your own... 
</li>
          <li>
You'll need a <span class="codetext">src/main/java</span> directory as a root source
folder (as per the <a href="http://maven.apache.org/maven-1.x/reference/conventions.html">Maven
convention</a>). Right-click on the project, select New-&gt;Source Folder and type
in <span class="codetext">src/main/java</span>. 
</li>
          <li>
Finally, in order to execute or debug the project on an actual running server, right-click
on the new project and select Properties. From there go to the Server tab and select
the runtime you created in the previous chapter.</li>
        </ul>
        <p>
At this point you have a Maven web project with a corresponding Eclipse project ready
for editing in your workspace. In practice you will have to do several things to have
any meaningful results.
</p>
        <ol>
          <li>
Add your own code into the mix, such as a servlet. When adding a new servlet (via
right-clicking the project, New-&gt;Other and choosing Web-&gt;Servlet) your <span class="codetext">WEB.XML</span> file
is automatically updated with the new servlet. 
</li>
          <li>
Add your own dependencies. Maven handles dependencies quite well; for instance, in
order to actually create a servlet you're going to need <span class="codetext">servlet-api.jar</span> in
your classpath; the easiest way to do this is to right-click the project, select Maven-&gt;Add
Dependency and then simply type in servlet and choose <span class="codetext">javax.servlet
servlet-api</span>. 
</li>
          <li>
When you wish to run or debug your servlet, right-click on its Java file and select
Run As-&gt;Run on Server (or Debug, as appropriate). Your applet should be happily
up and running.</li>
        </ol>
        <p>
          <u>5. Converting an existing project to Maven</u>
        </p>
        <p>
I'm not sure how to go about doing this for web projects, but converting regular projects
to use Maven is actually pretty straightforward; move your sources to the appropriate
directories according to the <a href="http://maven.apache.org/maven-1.x/reference/conventions.html">Maven
conventions</a>, right-click the project in Eclipse and choose Maven-&gt;Enable Dependency
Management; this will implicitly create a Maven project descriptor for you (<span class="codetext">POM.XML</span>)
and that's pretty much it. From that point on your Eclipse and Maven projects should
peacefully coexist, allowing you to leverage both tools for your purposes.
</p>
        <img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=08ee53ca-6d1a-4406-a7c4-579f6414db2a" />
      </body>
      <title>Beginner's Guide to Web Development (or, Getting Eclipse, WTP, Tomcat and Maven to play along)</title>
      <guid isPermaLink="false">http://www.tomergabel.com/PermaLink,guid,08ee53ca-6d1a-4406-a7c4-579f6414db2a.aspx</guid>
      <link>http://www.tomergabel.com/BeginnersGuideToWebDevelopmentOrGettingEclipseWTPTomcatAndMavenToPlayAlong.aspx</link>
      <pubDate>Wed, 05 Dec 2007 13:10:05 GMT</pubDate>
      <description>&lt;p&gt;
So you want a web project, a build system and a reasonable IDE to take care of the
annoying details for you, right? The good news are that it's actually quite possible
and there're many ways to do this. The bad news are that it's nigh impossible to get
them to play along if you don't already know how to do that. It took me days to find
a solution that finally seems to work, and I'd like to share it with you. I'm probably
missing a few important details or did something really really stupid along the way
(I'd appreciate comments!), but this process does seem to work. &lt;strong&gt;I'm not going
into essentials of Java-based web development here&lt;/strong&gt; -- if you want a more
basic explanation of the terminology, post a comment and I'll see what I can do...
&lt;/p&gt;
&lt;p&gt;
&lt;u&gt;1. Goal&lt;/u&gt;
&lt;/p&gt;
&lt;p&gt;
I want to:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Use a common, standard and powerful IDE to edit and debug my Java code, and preferably
provide a usable GUI interface for dependency and project management; 
&lt;li&gt;
Use a common, standard servlet container to host my servlet and still be able to control
and debug everything from the same IDE; 
&lt;li&gt;
Have a convenient way to handle internal-and-external dependencies without worrying
too much about the details; 
&lt;li&gt;
Be able to quickly compile, test and package my servlet for deployment; 
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;Understand as little as possible about the dependency stack of the tools
involved&lt;/strong&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I'm going to tell you how to achieve most of these goals, with two glaring omissions:
I won't show you how to do testing (I haven't successfully managed servlet unit testing
so far -- different post on that) and I can't help but delve into some of the more
annoying details involved with these tools and their dependencies. Sorry about that.
Additionally, some of the information here applies even if you use different tools,
but you're bound to face issues not covered here; don't assume I know more than you
do -- seek the answers, post them somewhere, and maybe the next person will actually
find what they're looking for!
&lt;/p&gt;
&lt;p&gt;
&lt;u&gt;2. Tools&lt;/u&gt;
&lt;/p&gt;
&lt;p&gt;
The tools used are:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;J2SE JDK&lt;/a&gt; is an obvious
must-have. Version used: JDK 6 update 3; 
&lt;li&gt;
&lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt; (but please don't download it just yet)
for code editing, debugging and project management; 
&lt;li&gt;
&lt;a href="http://www.eclipse.org/webtools/"&gt;Web Tools Platform&lt;/a&gt;: this is the Eclipse
plug-in that adds web development capabilities to the IDE, including J2EE dependency
management, hosting and running servlets from within the Eclipse workspace etc. This
would be a good time to run along to the &lt;a href="http://download.eclipse.org/webtools/downloads/"&gt;WTP
web-site&lt;/a&gt; and download the Web Tools Platform All-In-One package. I only used the
release version (2.0.1 at the time of writing this), so if you use another version
your mileage may vary; 
&lt;li&gt;
&lt;a href="http://maven.apache.org/"&gt;Apache Maven&lt;/a&gt; is the newfangled build system
from Apache slated to replace &lt;a href="http://ant.apache.org/"&gt;ant&lt;/a&gt;. I've used
it for the last few days and so far it appears to be quite robust and even fairly
well-integrated into Eclipse (see next item). Version used: 2.0.8; 
&lt;li&gt;
&lt;a href="http://m2eclipse.codehaus.org/"&gt;M2eclipse&lt;/a&gt; is the Eclipse plug-in for
Maven integration. I've only found one problem with it so far, which I'll detail later
on; 
&lt;li&gt;
&lt;a href="http://tomcat.apache.org/"&gt;Apache Tomcat&lt;/a&gt; is a solid choice in servlet
containers. It's robust, fast and open-source, and has terrific Eclipse integration.
I haven't given any of the other containers a serious whirl yet though.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;u&gt;3. Preparations&lt;/u&gt;
&lt;/p&gt;
&lt;p&gt;
Unlike Visual Studio, with the tools mentioned above there's no straightforward installation
procedure. You'll have to designate at least a workspace directory (where your Eclipse
projects, settings etc. go) and some location where the tools themselves go. For me,
it's C:\Dev\Eclipse and C:\Tools respectively.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Setting up Java: 
&lt;ul&gt;
&lt;li&gt;
Install the JDK and remember where it was installed (nominally in &lt;span class="codetext"&gt;%PROGRAMFILES%\Java\jdk1.6.0_03&lt;/span&gt;) 
&lt;li&gt;
Set up a system-wide &lt;span class="codetext"&gt;JAVA_HOME&lt;/span&gt; environment variable
pointing to the same directory&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Setting up Maven and Tomcat: 
&lt;ul&gt;
&lt;li&gt;
Extract both archives to your designated directory (e.g. for Maven it would be &lt;span class="codetext"&gt;C:\Tools\apache-maven-2.0.8&lt;/span&gt;) 
&lt;li&gt;
Add the Maven bin directory to your &lt;span class="codetext"&gt;PATH&lt;/span&gt; environment
variable (user- or system-wide, depending on your preference) 
&lt;li&gt;
Add whichever J2EE libraries you desire from the Tomcat installation to your class-path.
If you have no idea what I'm talking about, you'll probably just want to set the &lt;span class="codetext"&gt;CLASSPATH&lt;/span&gt; environment
variable to your equivalent of &lt;span class="codetext"&gt;c:\tools\apache-tomcat-6.0.14\lib\servlet-api.jar;c:\tools\apache-tomcat-6.0.14\lib\jsp-api.jar&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Setting up Eclipse: 
&lt;ul&gt;
&lt;li&gt;
Extract the WTP all-in-one package (which contains Eclipse itself) to your designated
directory (e.g. &lt;span class="codetext"&gt;C:\Tools\Eclipse&lt;/span&gt;) 
&lt;li&gt;
Load Eclipse and point it to your designated workspace location 
&lt;li&gt;
Install M2Eclipse: 
&lt;ul&gt;
&lt;li&gt;
Go to Help-&amp;gt;Software Updates-&amp;gt;Find and Install..., select "Search for new features
to install" and click Next 
&lt;li&gt;
Click on New Remote Site..., use M2eclipse or whatever for the name and &lt;a title="http://m2eclipse.codehaus.org/update/" href="http://m2eclipse.codehaus.org/update/"&gt;http://m2eclipse.codehaus.org/update/&lt;/a&gt; for
the URL 
&lt;li&gt;
Click on Finish and let Eclipse install the M2Eclipse plug-in&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Set up a web server runtime for Eclipse to host your servlets in: 
&lt;ul&gt;
&lt;li&gt;
Open Window-&amp;gt;Preferences... 
&lt;li&gt;
Under Server select Installed Runtimes and click on Add... 
&lt;li&gt;
Choose (from Apache) the Apache Tomcat v6.0 runtime and click Next 
&lt;li&gt;
Enter the Apache installation directory (e.g. &lt;span class="codetext"&gt;C:\Tools\apache-tomcat-6.0.14&lt;/span&gt;)
in the appropriate location and click Finish&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;u&gt;4. Creating a new web project&lt;/u&gt;
&lt;/p&gt;
&lt;p&gt;
First off, you must create the actual project, directory structure etc. To do this:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Open a command prompt, go to your Eclipse workspace directory 
&lt;li&gt;
Decide on your Maven group and artifact IDs; it's worth noting that the artifact ID
is also the directory name for the project 
&lt;li&gt;
Type in &lt;span class="codetext"&gt;mvn archetype:create -DgroupId=&lt;strong&gt;your.group.id&lt;/strong&gt; -DartifactId=&lt;strong&gt;your.artifact.id&lt;/strong&gt; -DarchetypeArtifactId=maven-archetype-webapp &lt;/span&gt; 
&lt;li&gt;
You'll notice that a new directory was created under the workspace root 
&lt;li&gt;
Edit the Maven project descriptor &lt;span class="codetext"&gt;POM.XML&lt;/span&gt; in the newly
created directory: 
&lt;ul&gt;
&lt;li&gt;
Add (after the &lt;span class="codetext"&gt;&amp;lt;url&amp;gt;&lt;/span&gt; tag, although I'm not sure
the order matters) the following section: &lt;blockquote style="font-family: monospace"&gt;&amp;lt;profiles&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;profile&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;id&amp;gt;servlet&amp;lt;/id&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activation&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activeByDefault&amp;gt;false&amp;lt;/activeByDefault&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/activation&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependencies&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependency&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;groupId&amp;gt;javax.servlet&amp;lt;/groupId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;artifactId&amp;gt;servlet-api&amp;lt;/artifactId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;version&amp;gt;2.5&amp;lt;/version&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependency&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependency&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;groupId&amp;gt;javax.servlet.jsp&amp;lt;/groupId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;artifactId&amp;gt;jsp-api&amp;lt;/artifactId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;version&amp;gt;2.1&amp;lt;/version&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependency&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependencies&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/profile&amp;gt;&lt;br&gt;
&amp;lt;/profiles&amp;gt; &lt;/blockquote&gt; 
&lt;li&gt;
Under &lt;span class="codetext"&gt;&amp;lt;build&amp;gt;&lt;/span&gt;, add the following section: &lt;blockquote style="font-family: monospace"&gt;&amp;lt;plugins&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugin&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.mortbay.jetty&amp;lt;/groupId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;maven-jetty-plugin&amp;lt;/artifactId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugin&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;configuration&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;source&amp;gt;1.5&amp;lt;/source&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;target&amp;gt;1.5&amp;lt;/target&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;br&gt;
&amp;lt;/plugins&amp;gt;&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
You can now thank my colleague &lt;a href="http://www.aviransplace.com/"&gt;Aviran Mordo&lt;/a&gt; for
finding out this bit of Voodoo. :-) 
&lt;li&gt;
In the command prompt, now enter the project directory 
&lt;li&gt;
Type in &lt;span class="codetext"&gt;mvn eclipse:m2eclipse -Dwtpversion=1.5&lt;/span&gt; to create
an Eclipse project 
&lt;li&gt;
Run Eclipse if it's not already started, then from the package explorer right click
anywhere and click on Import... 
&lt;li&gt;
Choose General-&amp;gt;Existing Projects into Workspace. For root directory pick the workspace
directory 
&lt;li&gt;
Choose the new project and click on Finish 
&lt;li&gt;
At this point you may encounter a "Java compiler level does not match the version
of the installed Java project facet" error. If that's the case, just right-click on
the error (in the Problems view) and select Quick Fix, which will allow you to change
the Java project facet version to 6.0. If this isn't what you want, you probably know
enough to resolve the issue on your own... 
&lt;li&gt;
You'll need a &lt;span class="codetext"&gt;src/main/java&lt;/span&gt; directory as a root source
folder (as per the &lt;a href="http://maven.apache.org/maven-1.x/reference/conventions.html"&gt;Maven
convention&lt;/a&gt;). Right-click on the project, select New-&amp;gt;Source Folder and type
in &lt;span class="codetext"&gt;src/main/java&lt;/span&gt;. 
&lt;li&gt;
Finally, in order to execute or debug the project on an actual running server, right-click
on the new project and select Properties. From there go to the Server tab and select
the runtime you created in the previous chapter.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
At this point you have a Maven web project with a corresponding Eclipse project ready
for editing in your workspace. In practice you will have to do several things to have
any meaningful results.
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Add your own code into the mix, such as a servlet. When adding a new servlet (via
right-clicking the project, New-&amp;gt;Other and choosing Web-&amp;gt;Servlet) your &lt;span class="codetext"&gt;WEB.XML&lt;/span&gt; file
is automatically updated with the new servlet. 
&lt;li&gt;
Add your own dependencies. Maven handles dependencies quite well; for instance, in
order to actually create a servlet you're going to need &lt;span class="codetext"&gt;servlet-api.jar&lt;/span&gt; in
your classpath; the easiest way to do this is to right-click the project, select Maven-&amp;gt;Add
Dependency and then simply type in servlet and choose &lt;span class="codetext"&gt;javax.servlet
servlet-api&lt;/span&gt;. 
&lt;li&gt;
When you wish to run or debug your servlet, right-click on its Java file and select
Run As-&amp;gt;Run on Server (or Debug, as appropriate). Your applet should be happily
up and running.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;u&gt;5. Converting an existing project to Maven&lt;/u&gt;
&lt;/p&gt;
&lt;p&gt;
I'm not sure how to go about doing this for web projects, but converting regular projects
to use Maven is actually pretty straightforward; move your sources to the appropriate
directories according to the &lt;a href="http://maven.apache.org/maven-1.x/reference/conventions.html"&gt;Maven
conventions&lt;/a&gt;, right-click the project in Eclipse and choose Maven-&amp;gt;Enable Dependency
Management; this will implicitly create a Maven project descriptor for you (&lt;span class="codetext"&gt;POM.XML&lt;/span&gt;)
and that's pretty much it. From that point on your Eclipse and Maven projects should
peacefully coexist, allowing you to leverage both tools for your purposes.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=08ee53ca-6d1a-4406-a7c4-579f6414db2a" /&gt;</description>
      <category>Development</category>
      <category>Development/Java</category>
    </item>
    <item>
      <trackback:ping>http://www.tomergabel.com/Trackback.aspx?guid=ac38738f-475d-4f04-ba64-aead90a9fb17</trackback:ping>
      <pingback:server>http://www.tomergabel.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.tomergabel.com/PermaLink,guid,ac38738f-475d-4f04-ba64-aead90a9fb17.aspx</pingback:target>
      <dc:creator>Tomer Gabel</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In case it wasn't obvious, I've been doing some Java development lately. One of the
curious things about doing development in the Java world is that, whereas in the Microsoft
world you get a fairly complete tool-chain direct from a commercial vendor, in the
Java world you're pretty much <em>dependant </em>on the open-source ecosystem built
around the essential Java technologies: Sun defines the APIs, the community provides
the tools. In many ways this is really really cool: many Java tools like JUnit are
so absolutely groundbreaking that they found their way into the common development
idiom irrespective of language, and the availability of tools for just about any purpose
is a tremendous advantage (being able to choose freely between Resin, Jetty, Tomcat
or any other commercial container, for instance, is a huge boon).
</p>
        <p>
This diversity and community-centric development ecosystem definitely comes with a
price though. Java tools, even the high-profile ones such as Eclipse, are extremely
difficult to work with for the uninitiated, with a learning curve somewhat like that
of Linux: if you take the time to learn the tools you can do astounding things and
remain in complete control of the system, but the sheer context required to do even
the most trivial thing can be - and often is - daunting.
</p>
        <p>
I've been battling these tools on and off for the last few weeks and often end up
having to figure something out on my own. Unlike the .NET ecosystem, it's usually
quite difficult to find a blog post detailing a solution to a particular problem.
To that end I intend to document my successes - victories, if you will - over the
tool-chain, and also the problems I encounter and haven't been able to solve, in the
hope of helping others and maybe myself in the process. These posts will go under
the Development-&gt;Java category, and I'd really appreciate any comments on the solutions
(so that I can improve my own work) as well as the problems (so I can actually solve
them). Here's to hoping :-)
</p>
        <img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=ac38738f-475d-4f04-ba64-aead90a9fb17" />
      </body>
      <title>Kickstarting the Java category on this blog</title>
      <guid isPermaLink="false">http://www.tomergabel.com/PermaLink,guid,ac38738f-475d-4f04-ba64-aead90a9fb17.aspx</guid>
      <link>http://www.tomergabel.com/KickstartingTheJavaCategoryOnThisBlog.aspx</link>
      <pubDate>Wed, 05 Dec 2007 09:48:11 GMT</pubDate>
      <description>&lt;p&gt;
In case it wasn't obvious, I've been doing some Java development lately. One of the
curious things about doing development in the Java world is that, whereas in the Microsoft
world you get a fairly complete tool-chain direct from a commercial vendor, in the
Java world you're pretty much &lt;em&gt;dependant &lt;/em&gt;on the open-source ecosystem built
around the essential Java technologies: Sun defines the APIs, the community provides
the tools. In many ways this is really really cool: many Java tools like JUnit are
so absolutely groundbreaking that they found their way into the common development
idiom irrespective of language, and the availability of tools for just about any purpose
is a tremendous advantage (being able to choose freely between Resin, Jetty, Tomcat
or any other commercial container, for instance, is a huge boon).
&lt;/p&gt;
&lt;p&gt;
This diversity and community-centric development ecosystem definitely comes with a
price though. Java tools, even the high-profile ones such as Eclipse, are extremely
difficult to work with for the uninitiated, with a learning curve somewhat like that
of Linux: if you take the time to learn the tools you can do astounding things and
remain in complete control of the system, but the sheer context required to do even
the most trivial thing can be - and often is - daunting.
&lt;/p&gt;
&lt;p&gt;
I've been battling these tools on and off for the last few weeks and often end up
having to figure something out on my own. Unlike the .NET ecosystem, it's usually
quite difficult to find a blog post detailing a solution to a particular problem.
To that end I intend to document my successes - victories, if you will - over the
tool-chain, and also the problems I encounter and haven't been able to solve, in the
hope of helping others and maybe myself in the process. These posts will go under
the Development-&amp;gt;Java category, and I'd really appreciate any comments on the solutions
(so that I can improve my own work) as well as the problems (so I can actually solve
them). Here's to hoping :-)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.tomergabel.com/aggbug.ashx?id=ac38738f-475d-4f04-ba64-aead90a9fb17" /&gt;</description>
      <category>Development</category>
      <category>Development/Java</category>
    </item>
  </channel>
</rss>