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

<channel>
	<title>SolitaryGeek &#187; Java</title>
	<atom:link href="http://solitarygeek.com/tag/java/feed" rel="self" type="application/rss+xml" />
	<link>http://solitarygeek.com</link>
	<description>Technical Productivity</description>
	<lastBuildDate>Mon, 28 Jun 2010 03:54:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What Java Look and Feel do you use?</title>
		<link>http://solitarygeek.com/java/what-java-look-and-feel-do-you-use</link>
		<comments>http://solitarygeek.com/java/what-java-look-and-feel-do-you-use#comments</comments>
		<pubDate>Mon, 09 Nov 2009 15:10:32 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Polls]]></category>
		<category><![CDATA[look and feel]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[themes]]></category>

		<guid isPermaLink="false">http://www.solitarygeek.com/?p=519</guid>
		<description><![CDATA[<p>Quite some time back, I read an article titled &#8220;20+ Free Look and Feel Libraries For Java Swing&#8220;. I have evaluated most of the libraries mentioned in that article. Personally, I  prefer the System look and feel that is bundled in the JRE. However, I like Substance, PGS and JGoodies as well. Which one do you <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/what-java-look-and-feel-do-you-use">What Java Look and Feel do you use?</a></span>]]></description>
			<content:encoded><![CDATA[<p>Quite some time back, I read an article titled &#8220;<a href="http://javabyexample.wisdomplug.com/web-programming/37-core-java/65-20-free-look-and-feel-libraries-for-java-swings.html">20+ Free Look and Feel Libraries For Java Swing</a>&#8220;. I have evaluated most of the libraries mentioned in that article. Personally, I  prefer the System look and feel that is bundled in the JRE. However, I like Substance, PGS and JGoodies as well. Which one do you use? Curious to know.</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/what-java-look-and-feel-do-you-use/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Developing A Simple Java Application With Spring</title>
		<link>http://solitarygeek.com/java/developing-a-simple-java-application-with-spring</link>
		<comments>http://solitarygeek.com/java/developing-a-simple-java-application-with-spring#comments</comments>
		<pubDate>Tue, 03 Nov 2009 16:12:23 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.solitarygeek.com/java/java-spring/</guid>
		<description><![CDATA[<p>Introduction
Spring is a powerful application framework that can be used across any layer in your application. For example, you can use Spring to manage only your data access layer or you can use Spring to provide remote services for your swing client. In this article, I will explain how to get started with Spring by developing <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/developing-a-simple-java-application-with-spring">Developing A Simple Java Application With Spring</a></span>]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong><br />
Spring is a powerful application framework that can be used across any layer in your application. For example, you can use Spring to manage only your data access layer or you can use Spring to provide remote services for your swing client. In this article, I will explain how to get started with Spring by developing a simple java application.</p>
<p><strong>Requirements</strong><br />
1. Your favorite IDE<br />
2. <a href="http://www.springsource.org/download">Latest Spring framework</a>.</p>
<p>(Note: This article makes use of Spring framework 2.5.6 which is the current production release)</p>
<p><strong>The Application</strong><br />
We are going to develop a simple application that fetches and display the list of registered users. The application consists of just two interfaces, their implementation.</p>
<p><strong>The DAO layer</strong><br />
Let us now develop the DAO layer of the application. This layer consists of just one interface &#8220;UserDao&#8221; and it&#8217;s implementation &#8220;UserDaoImpl&#8221;. The interface consists of just one method named &#8220;getUsers()&#8221;. Let us quickly develop them.</p>
<p>Listing 1. UserDao</p>
<pre class="brush: java;">
package com.springapp.dao;
import java.util.Iterator;

/**
 *
 * @author James
 */
public interface UserDao
{
    Iterator&lt;String&gt; getUsers();
}
</pre>
<p>Listing 2. UserDaoImpl</p>
<pre class="brush: java;">

package com.springapp.dao;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author James
 */
public class UserDaoImpl implements UserDao
{
    public Iterator&lt;String&gt; getUsers()
    {
        List&lt;String&gt; users = new ArrayList&lt;String&gt;();
        users.add(&quot;Gavin King&quot;);
        users.add(&quot;Geertjan&quot;);
        users.add(&quot;Mike Keith&quot;);
        users.add(&quot;James&quot;);
        return users.iterator();
    }
}
</pre>
<p>Nothing fancy here. The implementation is pretty straight forward, though in a real environment you might fetch those details from the database using ORM frameworks like JPA.</p>
<p><strong>The Service Layer</strong></p>
<p>We will encapsulate the service layer from the dao implementaion by writing code against the interface UserDao. We will follow the same pattern we used in developing the dao layer and write the interface UserService and it&#8217;s implementation UserServiceImpl.</p>
<p>Listing 3. UserService</p>
<pre class="brush: java;">

package com.springapp.service;

import java.util.Iterator;

/**
 *
 * @author James
 */
public interface UserService
{
    Iterator&lt;String&gt; getUsers();
}
</pre>
<p>Listing 4. UserServiceImpl</p>
<pre class="brush: java;">

package com.springapp.service;

import com.springapp.dao.UserDao;
import java.util.Iterator;

/**
 *
 * @author James
 */
public class UserServiceImpl implements UserService
{
    private UserDao userDao;

    public Iterator&lt;String&gt; getUsers()
    {
        return userDao.getUsers();
    }

    public void setUserDao(UserDao userDao)
    {
        this.userDao = userDao;
    }
}
</pre>
<p>Kindly notice that both the service layer classes and dao layer classes are Spring agnostic. That&#8217;s the beauty of Spring. Spring is less invasive. Most of the application code can be developed without knowing anything about Spring.</p>
<p><strong>The Client</strong></p>
<p>Now we need someone to make use of our service layer and we will waste no time in developing the client for our service. We can just write a junit test class to invoke our service but I prefer to write a simple java class to be the client. Though our client will be a simple POJO class, you can easily replace it with a Swing or Web front end. Enough talking, let us dive into action! We will first develop our client as a normal java class without using Spring.</p>
<p><em>Standard Client</em></p>
<p>Listing 5. StandardUserServiceClient</p>
<pre class="brush: java;">

package com.springapp;

import com.springapp.dao.UserDao;
import com.springapp.dao.UserDaoImpl;
import com.springapp.service.UserServiceImpl;
import java.util.Iterator;

/**
 *
 * @author James
 */
public class StandardUserServiceClient
{

    private UserServiceImpl userService;

    public StandardUserServiceClient()
    {
        userService = new UserServiceImpl();
        UserDao userDao = new UserDaoImpl();
        userService.setUserDao(userDao);
    }

    private void fetchUsers()
    {
        Iterator&lt;String&gt; users = userService.getUsers();
        while (users.hasNext())
        {
            System.out.println(users.next());
        }
    }

    public static void main(String[] args)
    {
        StandardUserServiceClient client = new StandardUserServiceClient();
        client.fetchUsers();
    }
}
</pre>
<p>Hmm, there you can see our client code is &#8220;coupled&#8221; tightly with the service and dao implementations. That&#8217;s where Spring comes to our rescue. Spring will dynamically &#8220;inject&#8221; the implemenations so our application will remain &#8220;loosely&#8221; coupled.</p>
<p><em>Spring Client</em></p>
<p>But how will Spring know about our implementations? We need to inform Spring a little about our application and define the &#8220;hotspots&#8221; where it can dynamically &#8220;inject&#8221; the dependencies or implementations. Spring expects these details in a configuration file and let us quickly write that. Create a package called &#8220;resources&#8221; and create a xml file called &#8220;applicationContext.xm&#8221; inside it.</p>
<p>Listing 6. applicationContext.xml</p>
<pre class="brush: xml;">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
 xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
 xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd&quot;&gt;

 &lt;bean id=&quot;userDao&quot; class=&quot;com.springapp.dao.UserDaoImpl&quot;&gt;
 &lt;/bean&gt;

 &lt;bean id=&quot;userService&quot; class=&quot;com.springapp.service.UserServiceImpl&quot;&gt;
     &lt;property name=&quot;userDao&quot; ref=&quot;userDao&quot;/&gt;
 &lt;/bean&gt;
&lt;/beans&gt;
</pre>
<p>In the &#8220;applicationContext.xml&#8221; file we defiend two beans named &#8220;userDao&#8221; and &#8220;userService&#8221;. We also specified their implementations using the &#8220;class&#8221; attribute. Also notice that we are setting the property &#8220;userDao&#8221;  in the &#8220;UserServiceImpl&#8221; class with &#8220;UserDaoImpl&#8221; by referencing it&#8217;s name &#8220;userDao&#8221;. Pretty straighforward!</p>
<p>Now it&#8217;s time to churn out our Spring client.</p>
<p>Listing 7. SpringUserServiceClient</p>
<pre class="brush: java;">

package com.springapp;

import com.springapp.service.UserService;
import java.util.Iterator;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 *
 * @author James
 */
public class SpringUserServiceClient
{
    private UserService userService;

    public SpringUserServiceClient()
    {
        //initialize the spring container
        ApplicationContext context = new ClassPathXmlApplicationContext(&quot;resources/applicationContext.xml&quot;);
        userService = (UserService) context.getBean(&quot;userService&quot;);
    }

    private void fetchUsers()
    {
        Iterator&lt;String&gt; users = userService.getUsers();
        while(users.hasNext())
        {
            System.out.println(users.next());
        }
    }

    public static void main(String[] args)
    {
        SpringUserServiceClient client = new SpringUserServiceClient();
        client.fetchUsers();
    }
}
</pre>
<p>A couple of details about this class:</p>
<ul>
<li>The ApplicationContext interface helps us to plug into the Spring container and lookup the classes we need by using the name we defined in the xml file.</li>
<li>There are many implementataions of ApplicationContext available in Spring. One of the most widely used implementation is &#8220;ClassPathXmlApplicationContext&#8221;. It is used to load Spring configuration files found in classpath.</li>
</ul>
<p>As seen from Listing 7, Spring helps us to program to interfaces and develop loosely coupled applications. As a result, applications become more testable as there are no external dependencies like application server. It is also very easy to switch the implementations effortlessly. For example, in our sample application you can easily write a UserDaoMockImpl and use it in your test cases effortlessly.</p>
<p><strong>Project Structure</strong></p>
<p>Here is the complete application looks like:</p>
<p><strong><img class="alignnone size-full wp-image-515" title="screenshot1" src="http://solitarygeek.com/blog/wp-content/uploads/2009/11/screenshot1.png" alt="screenshot1" width="302" height="310" /><br />
</strong></p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=d7d85c06-7c20-8a72-ae33-ec6bc5f32317" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/developing-a-simple-java-application-with-spring/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Developing A Simple Pluggable Java Application</title>
		<link>http://solitarygeek.com/java/a-simple-pluggable-java-application</link>
		<comments>http://solitarygeek.com/java/a-simple-pluggable-java-application#comments</comments>
		<pubDate>Sun, 20 Sep 2009 15:23:12 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[pluggable]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.solitarygeek.com/java/a-simple-pluggable-java-application/</guid>
		<description><![CDATA[<p>Most of the applications we use on daily basis are pluggable. Popular applications like Firefox, Eclipse, NetBeans, JEdit, Wordpress, Hudson are all pluggable. In fact, pluggability has played a major part in the success of most of these applications. Why not make the Java applications we develop pluggable as well? Yes, we get pluggability out of <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/a-simple-pluggable-java-application">Developing A Simple Pluggable Java Application</a></span>]]></description>
			<content:encoded><![CDATA[<p>Most of the applications we use on daily basis are pluggable. Popular applications like Firefox, Eclipse, NetBeans, JEdit, Wordpress, Hudson are all pluggable. In fact, pluggability has played a major part in the success of most of these applications. Why not make the Java applications we develop pluggable as well? Yes, we get pluggability out of the box, if our applications are based on a rich client platform like NetBeans or Eclipse. But for some reasons if you decide not to use those platforms, it doesn&#8217;t mean that they should not be pluggable. In this article, we will learn how to write a simple pluggable application that will load it&#8217;s plugins dynamically.</p>
<p><strong>The API<br />
</strong>First, let us define a plugin interface that should be implemented by all the plugins of our application. We are going to keep it very simple. Create a project called &#8220;plugin-api&#8221; in your favorite IDE and create the interface &#8220;ApplicationPlugin&#8221;.</p>
<p><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/09/screenshot1-p2.png" alt="" /></p>
<pre class="brush: java;">

package com.pluggableapp.plugins.api;

public interface ApplicationPlugin
{
    String getName();
    void init();
}
</pre>
<p><span id="more-464"></span></p>
<p><strong>The Plugins</strong></p>
<p>Writing the plugins now is very easy. Our plugins need to implement the plugin interface and follow a simple convention to make it easy for our applications to find them later. Create a project called &#8220;plugin-a&#8221; and develop our first plugin.</p>
<pre class="brush: java;">

package com.pluggableapp.plugins;

import com.pluggableapp.plugins.api.ApplicationPlugin;
import java.util.logging.Logger;

public class PluginA implements ApplicationPlugin
{
    private static Logger logger = Logger.getLogger(PluginA.class.getName());

    public String getName()
    {
        return &quot;Plugin A&quot;;
    }

    public void init()
    {
        logger.info(getName() + &quot; initialized!&quot;);
    }
}
</pre>
<p>Now create a directory called &#8220;META-INF/services&#8221; inside the source directory and create a file with the name &#8220;com.pluggableapp.plugins.api.ApplicationPlugin&#8221; (This is the fully qualified name of the plugin interface). The file should contain the name of the actual plugin inside it. In our case, the text is &#8220;com.pluggableapp.plugins.PluginA&#8221;.</p>
<p><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/09/screenshot4-p.png" alt="" /></p>
<p>Repeat these steps to create PluginB.</p>
<p><strong>The Application</strong></p>
<p>It&#8217;s time to create the application that will consume the plugins we created. First let us create a class to add the plugin jars to the classpath dynamically.</p>
<pre class="brush: java;">

package com.pluggableapp;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.logging.Logger;

public class ClasspathUtils
{

 private static Logger logger = Logger.getLogger(ClasspathUtils.class.getName());
 // Parameters
 private static final Class[] parameters = new Class[]
 {
     URL.class
 };

 /**
 * Adds the jars in the given directory to classpath
 * @param directory
 * @throws IOException
 */
 public static void addDirToClasspath(File directory) throws IOException
 {
     if (directory.exists())
     {
         File[] files = directory.listFiles();
         for (int i = 0; i &lt; files.length; i++)
         {
             File file = files[i];
             addURL(file.toURI().toURL());
         }
     }
     else
     {
         logger.warning(&quot;The directory \&quot;&quot; + directory + &quot;\&quot; does not exist!&quot;);
     }
}

 /**
 * Add URL to CLASSPATH
 * @param u URL
 * @throws IOException IOException
 */
 public static void addURL(URL u) throws IOException
 {
     URLClassLoader sysLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
     URL urls[] = sysLoader.getURLs();
     for (int i = 0; i &lt; urls.length; i++)
     {
         if (urls[i].toString().equalsIgnoreCase(u.toString()))
         {
             logger.info(&quot;URL &quot; + u + &quot; is already in the CLASSPATH&quot;);
             return;
         }
     }
     Class sysclass = URLClassLoader.class;
     try
     {
         Method method = sysclass.getDeclaredMethod(&quot;addURL&quot;, parameters);
         method.setAccessible(true);
         method.invoke(sysLoader, new Object[]
         {
             u
         });
     } catch (Throwable t)
     {
         t.printStackTrace();
         throw new IOException(&quot;Error, could not add URL to system classloader&quot;);
     }
  }
}
</pre>
<p>Now create an interface called &#8220;PluginService&#8221; to define the methods needed to load and initialize the plugins.</p>
<pre class="brush: java;">

package com.pluggableapp;

import com.pluggableapp.plugins.api.ApplicationPlugin;
import java.util.Iterator;

public interface PluginService
{
    Iterator&lt;ApplicationPlugin&gt; getPlugins();
    void initPlugins();
}
</pre>
<p>As of version 1.6, the Java runtime ships with a class called &#8220;ServiceLoader&#8221; to easily find and load plugins. Let us now write a implementation called &#8220;StandardPluginService&#8221; and make use of the facilities built into the java runtime.</p>
<pre class="brush: java;">

package com.pluggableapp;

import com.pluggableapp.PluginService;
import com.pluggableapp.plugins.api.ApplicationPlugin;
import java.util.Iterator;
import java.util.ServiceLoader;
import java.util.logging.Logger;

public class StandardPluginService implements PluginService
{
    private static StandardPluginService pluginService;
    private ServiceLoader&lt;ApplicationPlugin&gt; serviceLoader;
    private Logger logger = Logger.getLogger(getClass().getName());

    private StandardPluginService()
    {
        //load all the classes in the classpath that have implemented the interface
        serviceLoader = ServiceLoader.load(ApplicationPlugin.class);
    }

    public static StandardPluginService getInstance()
    {
        if(pluginService == null)
        {
            pluginService = new StandardPluginService();
        }
        return pluginService;
    }

    public Iterator&lt;ApplicationPlugin&gt; getPlugins()
    {
        return serviceLoader.iterator();
    }

    public void initPlugins()
    {
        Iterator&lt;ApplicationPlugin&gt; iterator = getPlugins();
        if(!iterator.hasNext())
        {
            logger.info(&quot;No plugins were found!&quot;);
        }
        while(iterator.hasNext())
        {
            ApplicationPlugin plugin = iterator.next();
            logger.info(&quot;Initializing the plugin &quot; + plugin.getName());
            plugin.init();
        }
    }
}
</pre>
<p>Feel free to write your own implementation if needed. For example you can easily write an implementation based on the NetBeans API.</p>
<p>Write a factory class named &#8220;PluginServiceFactory&#8221; to create &#8220;PluginService&#8221; objects.</p>
<pre class="brush: java;">

package com.pluggableapp;

import com.pluggableapp.*;
import com.pluggableapp.StandardPluginService;
import com.pluggableapp.PluginService;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class PluginServiceFactory
{
    public static PluginService createPluginService()
    {
        addPluginJarsToClasspath();
        return StandardPluginService.getInstance();
    }

    private static void addPluginJarsToClasspath()
    {
        try
        {
            //add the plugin directory to classpath
            ClasspathUtils.addDirToClasspath(new File(&quot;plugins&quot;));
        } catch (IOException ex)
        {
            Logger.getLogger(PluginServiceFactory.class.getName()).log(
                Level.SEVERE, null, ex);
        }
    }
}
</pre>
<p>That&#8217;s it. All we need to do now is to write a class that will invoke the &#8220;PluginServiceFactory&#8221;.</p>
<pre class="brush: java;">

package com.pluggableapp;

import com.pluggableapp.plugins.api.ApplicationPlugin;
import java.util.Iterator;
import java.util.logging.Logger;

public class Main
{

    private static Logger logger = Logger.getLogger(Main.class.getName());

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args)
    {
        loadPlugins();
    }

    private static void loadPlugins()
    {
        PluginService pluginService = PluginServiceFactory.createPluginService();
        pluginService.initPlugins();
    }
}
</pre>
<p>Before we build and see the application in action, create a directory called &#8220;plugins&#8221; and put all plugin jars there.</p>
<p><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/09/screenshot3-p1.png" alt="" /></p>
<p>And this is what you might see when you run our pluggable application.</p>
<p><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/09/screenshot2-p1.png" alt="" /></p>
<p>Now feel free to create as many plugins you want to write and just drop them in the &#8220;plugins&#8221; directory and restart the &#8220;pluggable&#8221; application to see your &#8220;home grown&#8221; plugins in action!</p>
<p><strong>Resources</strong></p>
<p><a href="http://java.sun.com/developer/technicalArticles/javase/extensible/index.html">Creating Extensible Applications With the Java Platform</a> &#8211; <em>John O&#8217;Conner</em></p>
<p><a href="http://twit88.com/blog/2007/10/07/develop-a-java-plugin-framework/">Developing a Java Plugin Framework </a></p>
<p><a href="http://java.dzone.com/news/how-create-pluggable-photo-alb">How to Create a Pluggable Photo Album in Java</a> &#8211; <em>Geertjan</em></p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=d7d85c06-7c20-8a72-ae33-ec6bc5f32317" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/a-simple-pluggable-java-application/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Five different uses of Java Applets</title>
		<link>http://solitarygeek.com/java/five-different-uses-of-java-applets</link>
		<comments>http://solitarygeek.com/java/five-different-uses-of-java-applets#comments</comments>
		<pubDate>Sat, 22 Aug 2009 09:54:42 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[applets]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.solitarygeek.com/java/java-technology-tech-computers-software-applications-tools-applets/</guid>
		<description><![CDATA[<p>In a world where everyone is using technologies like Flash, Silverlight etc to present rich content, are Java Applets still used? Are they still relevant? The answer is &#8211; &#8220;Yes&#8221;. Apart from being used primarily for playing online games, Java Applets are still used in many different ways. Here I would like to highlight a few <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/five-different-uses-of-java-applets">Five different uses of Java Applets</a></span>]]></description>
			<content:encoded><![CDATA[<p>In a world where everyone is using technologies like Flash, Silverlight etc to present rich content, are Java Applets still used? Are they still relevant? The answer is &#8211; &#8220;Yes&#8221;. Apart from being used primarily for playing online games, Java Applets are still used in many different ways. Here I would like to highlight a few applications that put Applets to good use.</p>
<p><strong>1. Online Office Suite</strong><br />
<a href="http://thinkfree.com">ThinkFree</a> is a very popular and professional online office suite <a href="http://en.wikipedia.org/wiki/ThinkFree_Office">based on Java Applet and Ajax</a>.</p>
<p><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/08/screenshot2-p1.png" alt="" /></p>
<p><strong>2. Virtualization</strong><br />
<a href="http://www-jpc.physics.ox.ac.uk/home_home.html">JPC</a> or <a href="http://www-jpc.physics.ox.ac.uk/home_home.html">Java PC Emulator</a> is a pure java based virtualization software that can be used to boot your virtual computers right inside the browser. Yes they run as &#8220;Java Applets&#8221; inside the browser.</p>
<p><strong>3. Remote Desktop Viewer</strong><br />
Products like <a href="http://www.tightvnc.com/">TightVNC</a> and <a href="http://www.uvnc.com/">UltraVNC</a> provide a java applet based client to view remote desktops.</p>
<p><strong>4. (Web) Operating System<br />
</strong><a href="http://icloud.com">iCloud</a>, is an web operating sytem that makes use of XML and Java Applet Technology (atleast for Firefox).</p>
<p><strong>5. File Upload</strong></p>
<p><a href="http://www.facebook.com">Facebook</a> uses a beautifully designed Java Applet to upload photos to facebook photo albums.<br />
<a href="http://net2ftp.com">net2ftp</a> is a web based ftp client that makes use of tiny Java Applet to &#8220;drag and drop&#8221; files from local computer to the browser and upload them to the remote ftp server.</p>
<p><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/08/screenshot1-p.png" alt="" /></p>
<p>If you have come across any website that make use of Java Applets, please share your thoughts in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/five-different-uses-of-java-applets/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hudson CI Server &#8211; A quick start guide</title>
		<link>http://solitarygeek.com/java/hudson-ci-server-a-step-by-step-guide-part-i</link>
		<comments>http://solitarygeek.com/java/hudson-ci-server-a-step-by-step-guide-part-i#comments</comments>
		<pubDate>Fri, 24 Jul 2009 14:53:26 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[continuous-integration]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[hudson]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.solitarygeek.com/?p=120</guid>
		<description><![CDATA[<p>Introduction</p>
<p>  Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily &#8211; leading to multiple integrations per day.
- Martin Fowler</p>
<p> Hudson is a popular open-source continuous integration server used by many organizations like Redhat JBoss. Though there are many well known and <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/hudson-ci-server-a-step-by-step-guide-part-i">Hudson CI Server &#8211; A quick start guide</a></span>]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p><strong> </strong> Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily &#8211; leading to multiple integrations per day.<br />
- <a href="http://martinfowler.com/articles/continuousIntegration.html">Martin Fowler</a></p>
<p><span> </span><span><a href="https://hudson.dev.java.net/">Hudson</a></span><span> is a popular open-source continuous integration server used by many organizations like Redhat <a href="http://hudson.jboss.org/hudson/">JBoss</a>. Though there are many well known and well established open-source projects like <a href="http://cruisecontrol.sourceforge.net/">CruiseControl</a>, <a href="http://continuum.apache.org/">Continnum</a></span><span> and some commercial offerings like <a href="http://www.atlassian.com/software/bamboo/">Bamboo</a>, what makes </span><span>Hudson special is it&#8217;s powerful yet easy to use web interface, it&#8217;s simplicity and it&#8217;s extensible architecture with many plugins.</span></p>
<p><span><span id="more-120"></span></span><span><br />
</span><span><strong>Objective</strong></span></p>
<p><span><strong> </strong>The objective of this tutorial is to setup, configure and learn to use <a href="https://hudson.dev.java.net/">Hudson</a> by building &#8220;<a href="http://commons.apache.org/io/">Apache Commons IO</a>&#8220;, a well known java project.<br />
<strong><br />
</strong></span><span><strong>Requirements<br />
</strong></span></p>
<ul>
<li><span><a href="https://hudson.dev.java.net/">Hudson</a></span></li>
<li><span>Subversion (or any other version control system like CVS, Mercurial, Git if you want to build your own project)<br />
</span></li>
<li><span>(Optional) <a href="http://tomcat.apache.org/">Tomcat</a> or <a href="https://glassfish.dev.java.net/">Glassfish</a></span></li>
<li><span>Apache Ant (or Maven)<br />
</span></li>
</ul>
<p><span><strong>Installation and Starting Hudson</strong></span></p>
<p><span>Installing Hudson is super easy. Just download the <a href="http://hudson-ci.org/latest/hudson.war">war</a> file, open your terminal/command-prompt and issue the command &#8220;java -jar hudson.war&#8221;. Now point your browser to <a href="http://localhost:8080">http://localhost:8080</a>. That was easy, right?</span></p>
<p><span>Hudson has an embedded servlet container called &#8220;<a href="http://winstone.sourceforge.net/">Winstone</a>&#8221; which works much like a standard servlet container like Tomcat by serving your JSP pages and servlets.</span></p>
<p><span>If you want Hudson to start on a different port, say 8180, issue the following command,<br />
&lt;code&gt; java -jar hudson.war &#8211;httpPort=8180 &lt;/code&gt;</span></p>
<p><span>Ofcourse you can deploy Hudson to Tomcat, Glassfish or any other supported servlet containers. The following guides can be useful in that case:<br />
</span></p>
<ul>
<li><span><a href="http://wiki.hudson-ci.org/display/HUDSON/Tomcat">Hudson and Tomcat</a></span></li>
<li><span><a href="https://hudson.dev.java.net/containers/glassfish.html">Hudson and Glassfish</a></span></li>
</ul>
<p><span>More container specific guides can be found from this <a href="http://wiki.hudson-ci.org/display/HUDSON/Containers">hudson wiki</a>.</span></p>
<p><span>Once you started Hudson or deployed it to a servlet container, this is what you might see in your browser when you start Hudson for the first time.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson1-p.png" alt="" /></span></p>
<p><span><strong>Hudson Home Directory</strong></span></p>
<p><span>All your Hudson jobs/settings are stored in the Hudson home directory. If you did not specify one, Hudson shall assume some defaults like &lt;code&gt; ~/.hudson &lt;/code&gt; in Linux or your respective home directory in Windows. It&#8217;s ok to go ahead with the defaults while you test drive Hudson but once you are done, I strongly recommend you to define a Hudson home directory of your choice, preferrably on a separate partition or drive. This will ensure that all your Hudson configuration/jobs are intact in case of any system crash.</span></p>
<p><span>Say, suppose your home directory is &#8220;/hudson&#8221; (in Linux), this is how you will define the Hudson home directory,</span></p>
<p><span>If you are using the embedded servlet container,<em> </em>start it by specifying the java system property &#8220;HUDSON_HOME&#8221;,<br />
&lt;code&gt; java -DHUDSON_HOME=/hudson -jar hudson.war &lt;/code&gt;</span></p>
<p><span>If you are using Tomcat, follow the explanations in <a href="http://wiki.hudson-ci.org/display/HUDSON/Tomcat">this wiki</a>. However, if you run Tomcat as a windows service, you need to do some tweaking to let Tomcat set this property. In that case, you will be better off if you start Tomcat using it&#8217;s batch file and set the property right there. (Or if you managed to run Tomcat as a Windows Service and still able to define the Hudson home correctly, why don&#8217;t you share your views with us?)</span></p>
<p><span>If you are using Glassfish, go to admin console and add the JVM option &lt;code&gt; -DHUDSON_HOME=/hudson&lt;/code&gt;. More detailed explanations can be found on <a href="http://wiki.hudson-ci.org/display/HUDSON/Glassfish">this wiki</a>.</span></p>
<p><span>Just remember that the idea is to define a system property &#8220;HUDSON_HOME&#8221; through any of the possible ways.</span></p>
<p><span>This is how the Hudson home directory shall look like.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson2-p.png" alt="" /></span></p>
<p><span><strong>Manage Hudson</strong></span></p>
<p><span><strong> </strong>Hudson provides an easy to use web interface to manage the configurations needed to administer a continuous integration server. Let us do some basic configurations to get Hudson ready.</span></p>
<p><span>Start Hudson and click the &#8220;Manage Hudson&#8221; link located on the left. </span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson3-p.png" alt="" /></span></p>
<p><span>Now click &#8220;Configure System&#8221;. Hudson will display a page where you can configure things like access control, JDK, Ant, Email Settings etc.<br />
</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson4-p.png" alt="" /></span></p>
<p><span><em><strong>Access Control</strong></em></span></p>
<p><span><em> </em>We will enable security to secure our Hudson setup. Otherwise anybody can go and meddle with your Hudson jobs. If you don&#8217;t want that to happen, check the &#8220;Enable Security&#8221; checkbox.</span></p>
<p><span><img class="alignnone size-full wp-image-128" title="hudson4a-3-p" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson4a-3-p.png" alt="hudson4a-3-p" width="498" height="76" /></span></p>
<p><span>[smartads]<br />
</span></p>
<p><span> </span></p>
<p><span>Once security is enabled, we need to tell Hudson the type of &#8220;Access Control&#8221; we want to use. Let us choose the Security Realm as &#8220;Hudson&#8217;s own user database&#8221; and leave the option &#8220;Enable users to signup&#8221; as checked. (If you do not check the &#8220;sign up&#8221; option here, Hudson is definitely going to whack you later!. ) Under the &#8220;Authorization&#8221; section, choose &#8220;Matrix-based Security&#8221;.</span></p>
<p><span><img class="alignnone size-full wp-image-129" title="hudson4a-4-p" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson4a-4-p.png" alt="hudson4a-4-p" width="382" height="330" /><br />
</span></p>
<p><span> </span></p>
<p><span>Now add an user called &#8220;administrator&#8221; and give the necessary privileges. ENSURE THAT YOU GIVE &#8220;ADMINISTER&#8221; PRIVILEGES TO THIS USER or else, you may not able to access the administrative console once security and access control are enabled. (Again, if you miss it, Hudson is gonna whack you!)</span></p>
<p><span><img class="alignnone size-full wp-image-130" title="hudson6-1-p" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson6-1-p.png" alt="hudson6-1-p" width="579" height="118" /><br />
</span></p>
<p><span> </span></p>
<p><span>Hudson will display an error symbol near the user we just added. That&#8217;s because the user does not exist  in the system. Do not bother, we will create the user a little later. Now go ahead and add users who might be accessing Hudson. Give appropriate access controls to the users and do not give full access to everyone. That will eventually create a system that is difficult to manage. </span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson7-p.png" alt="" /></span></p>
<p><span><strong><em>Configure JDK</em></strong></span></p>
<p><span>Done with security? Now we need to configure the JDK which Hudson shall use to build the jobs. Find out the section &#8220;JDK&#8221; in the same page. Click the &#8220;Add JDK&#8221; button and then enter the details of your JDK.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson9-p.png" alt="" /></span></p>
<p><span><em><strong>Configure Ant</strong></em></span></p>
<p><span><em> </em>We need to tell Hudson where Ant is located. Find out the section called &#8220;Ant&#8221;, click &#8220;Add Ant&#8221; and enter the respective details.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson10-p.png" alt="" /></span></p>
<p><span>(Follow the same procedure, if you want to configure Maven.)</span></p>
<p><span>That&#8217;s it! Hudson is now almost ready for prime time. Feel free to configure the Email Settings as well with the appropriate values. When you are done, press the &#8220;Save&#8221; button to save all the changes you have made.</span></p>
<p><span>Once you press the &#8220;Save&#8221; button, Hudson will redirect you to a login page.</span></p>
<p><span><em><strong>Manage Users</strong></em></span></p>
<p><span><em> </em>Click the &#8220;Signup&#8221; link at the top right corner of Hudson and register a new user called &#8220;administrator&#8221; (or whatever name you gave in the &#8220;Access Control&#8221; section).</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson13-p.png" alt="" /></span></p>
<p><span>Hudson will automatically login the user provided the user was already configured in the &#8220;Access Control&#8221; section. Once a new user (administrator) is registered in the system, Hudson will provide an option called &#8220;Manage Users&#8221; in the &#8220;Manage Hudson&#8221; page.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson15-p.png" alt="" /></span></p>
<p><span>You can now create other users from this page.</span></p>
<p><span><img class="alignnone size-full wp-image-125" title="hudson16-1-p" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson16-1-p.png" alt="hudson16-1-p" width="345" height="183" /><br />
</span></p>
<p><span>You will be using this page to manage all your Hudson users. Looks like we have covered quite a lot of information. It&#8217;s time now to create some jobs and see Hudson in action.</span></p>
<p><span><strong>Creating Job</strong></span></p>
<p><span><strong> </strong>That&#8217;s the core feature of Hudson. Hudson jobs can fetch the source code from a repository, execute your build scripts, run your tests, prepare javadoc, notify you in case of any failure, archive the build artifacts and much more. That&#8217;s where you can really see the power of Hudson. Enough talking, let us explore these Hudson features now by creating a job.</span></p>
<p><span>The Hudson job which we are going to create now is going to be very simple and is capable of doing the following:<br />
</span></p>
<ul>
<li><span>Checkout the source code of <a href="http://commons.apache.org/io/">apache commons-io</a> project using subversion<br />
</span></li>
<li><span>Run the build script (build.xml in case of Ant, pom.xml for Maven)</span></li>
<li><span>Archive the build output<br />
</span></li>
</ul>
<p><span>Create a job by clicking the link &#8220;New Job&#8221; on the left. Give a name for the job, select the option &#8220;Build a free-style software project&#8221; and then press &#8220;OK&#8221;.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson18-p.png" alt="" /></span></p>
<p><span><strong>Configure Job</strong><br />
</span></p>
<p><span> Hudson will create a new empty job for us which we need to configure.</span></p>
<p><span><img class="alignnone size-full wp-image-127" title="hudson19-1-p" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson19-1-p.png" alt="hudson19-1-p" width="496" height="253" /><br />
</span></p>
<p><span> </span></p>
<p><span>Let us configure the repository for this job first. Go to the section &#8220;Source Code Management&#8221;, choose the option &#8220;Subversion&#8221; and enter the repository url  as &#8220;<a href="http://svn.apache.org/repos/asf/commons/proper/io/trunk">http://svn.apache.org/repos/asf/commons/proper/io/trunk</a>&#8220;. Enter the &#8220;Local module directory&#8221; as  &#8220;.&#8221;</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson20-p.png" alt="" /></span></p>
<p><span>Look for the section called &#8220;Build&#8221;. Click the button &#8220;Add build step&#8221; and select &#8220;Invoke Ant&#8221;. Leave the rest to default. (Maven users, choose the appropriate action)</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson22-p1.png" alt="" /></span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson23-p.png" alt="" /><br />
Go to the section &#8220;Post-build Actions&#8221;. Select the checkbox &#8220;Archive the artifacts&#8221;. The apache commons-io build script shall create the jar in the directory named &#8220;target&#8221;. So enter the value &#8220;target/*.jar&#8221; in the text field titled &#8220;Files to archive&#8221;. Though this is not mandatory to build a job, I recommend you to do this as this will help the users of your continuous integration server to download the build outputs quickly.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson24-p.png" alt="" /></span></p>
<p><em><span> NOTE: Since we are building the apache-commons-io project we are entering the value &#8220;target/*.jar&#8221;. If for example, your build output directory is &#8220;dist&#8221;, then you should enter here as &#8220;dist/*.jar&#8221;.</span><br />
</em><span><br />
Press the &#8220;Save&#8221; button at the bottom. Our job is ready and just click link &#8220;Build Now&#8221; at the left to start building the job.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson25-p.png" alt="" /></span></p>
<p><span>Once the build is initiated, you can relax and watch the progress in the &#8220;Build History&#8221;.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson26-p.png" alt="" /></span></p>
<p><span>If you are restless and want to see exactly what is going on, just click the link (corresponding to the build number) in the &#8220;Build History&#8221;.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson27-p.png" alt="" /></span></p>
<p><span>Now click the link &#8220;Console Output&#8221;.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson28-p.png" alt="" /></span></p>
<p><span>Hudson will display you the console view where you can do all your research.</span></p>
<p><span><br />
</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson29-p.png" alt="" /></span></p>
<p><span>Now that the build is successful, you might want to have a look at the jar built by this job. You can find that under &#8220;Last Successful Artifacts&#8221;. </span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson30-p.png" alt="" /></span></p>
<p><span>You can also have a sneak preview about the builds from your Hudson home page.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson31-p.png" alt="" /></span></p>
<p><span>If in case some of your builds failed, Hudson will report that as well neatly along with displaying the build stability. </span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/hudson32-p.png" alt="" /></span></p>
<p><span>That&#8217;s it for now. But you can do a lot more like configuring Hudson to build this job every few minutes or just poll the repository once in a while and trigger the build whenever someone commits to the repository. Explore them under the job&#8217;s configuration page and enjoy. And did I mention that Hudson has a lot of good plugins already? Maybe I will try to cover those advanced concepts in my next post.</span></p>
<p><span>If you are using NetBeans as your IDE, then you have a got a lot of Hudson features integrated right into the NetBeans IDE. Check that out in my post <a href="http://www.solitarygeek.com/java/netbeans-6-7-a-quick-glance/">NetBeans 6.7 &#8211; A quick glance</a>.</span></p>
<p><span>Are you using Hudson? Are you planning to use Hudson? Why not leave a comment below and share your thoughts?<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/hudson-ci-server-a-step-by-step-guide-part-i/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>NetBeans 6.7 &#8211; A quick glance</title>
		<link>http://solitarygeek.com/java/netbeans-6-7-a-quick-glance</link>
		<comments>http://solitarygeek.com/java/netbeans-6-7-a-quick-glance#comments</comments>
		<pubDate>Tue, 07 Jul 2009 15:30:58 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.solitarygeek.com/java/netbeans-netbeans-6-7/</guid>
		<description><![CDATA[<p>NetBeans 5.0 &#8211; Simplified Swing development
NetBeans 5.5 &#8211; Simplified Java EE development
NetBeans 6.0 &#8211; Made the NetBeans editor and other core infrastructure on par with competitors
NetBeans 6.5 &#8211; Looked beyond Java development by supporting languages like PHP
NetBeans 7.0 6.7 &#8211; Tries to make collaborative team development seamless.</p>
<p>I was quick to download the &#8220;All Java&#8221; pack of <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/netbeans-6-7-a-quick-glance">NetBeans 6.7 &#8211; A quick glance</a></span>]]></description>
			<content:encoded><![CDATA[<p><span>NetBeans 5.0 &#8211; Simplified Swing development<br />
NetBeans 5.5 &#8211; Simplified Java EE development<br />
NetBeans 6.0 &#8211; Made the NetBeans editor and other core infrastructure on par with competitors<br />
NetBeans 6.5 &#8211; Looked beyond Java development by supporting languages like PHP<br />
NetBeans <span style="text-decoration: line-through;">7.0</span> 6.7 &#8211; Tries to make collaborative team development seamless.</span></p>
<p><span>I was quick to download the &#8220;All Java&#8221; pack of <a href="http://www.netbeans.org/downloads/index.html">NetBeans</a> IDE for linux. Installation, as usual was pretty smooth on my Ubuntu 9.04. The installation didn&#8217;t give me much surprises and it was very much similar to version 6.5. I customized the installer to install Glassfish v2.1 and Tomcat 6.0.18 for me.</span></p>
<p><span><span id="more-36"></span><strong>Splash Screen</strong><br />
The splash screen has changed a bit and the startup was quick. But I wouldn&#8217;t comment about the startup speed at this point of time since I haven&#8217;t created/opened any projects in the IDE.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/Screenshot1a.png" alt="" /></span></p>
<p><span><strong>Intuitive Start Page<br />
</strong>The start page has got the much needed face lift and is very attractive. The big and clean text reminded me about Eclipse which has got a really good start page. With this new start page, installing plugins is just one click away.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/Screenshot2.png" alt="" /></span></p>
<p><span> </span><span>The start page also offers an intuitive way to activate/de-activate IDE features. Say suppose you don&#8217;t want certain IDE features, for example, Mobile development, it&#8217;s very easy to turn it off right from your start page. Good work!</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/Screenshot3a.png" alt="" /></span></p>
<p><span><strong>Hudson Integration<br />
</strong>That&#8217;s my favourite feature in this release of NetBeans. <a href="http://hudson.dev.java.net">Hudson</a> is a great continuous integration server which helps you to automate your build process. And if your team uses Hudson, then this NetBeans feature might be very useful to you. As per my understanding, currently NetBeans supports only Hudson continuous integration server. If you are using other CI servers like CruiseControl, no great news for you in this release of NetBeans. <img src='http://solitarygeek.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </span></p>
<p><span>[smartads]<br />
</span></p>
<p><span>Open the &#8220;Services&#8221; window in the IDE and look for &#8220;Hudson Builders&#8221;. There you can add your existing hudson urls.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/Screenshot5.png" alt="" /></span></p>
<p><span>With the hudson support, you can now manage the hudson jobs without opening a browser. You can even copy the build artifacts to your netbeans projects.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/Screenshot6a.png" alt="" /></span></p>
<p><span>You can also watch the remote hudson build console at the comfort of your IDE.</span></p>
<p><span><strong>Issue Tracker Integration<br />
</strong>If you are doing any serious development, it&#8217;s most likely that you will be using some issue tracker. There are many popular issue trackers available like <a href="http://www.bugzilla.org/">Bugzilla</a>, <a href="http://trac.edgewall.org/">Trac</a>, <a href="http://www.atlassian.com/software/jira/">Jira</a> etc. NetBeans 6.7 provides out of the box support for Bugzilla but Jira support is available as well through a plugin.</span></p>
<p><span>I registered my mozilla issue tracker account in the IDE. Once an issue tracker is registered, you can find as well as add/modify issues.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/Screenshot7.png" alt="" /></span></p>
<p><span>Finding issues from a bugzilla based issue tracking system is just a click away.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/Screenshot8a.png" alt="" /></span></p>
<p><span>Reporting new issues is not a tough job either.</span></p>
<p><span><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/Screenshot9a.png" alt="" /></span></p>
<p><span>I didn&#8217;t try the Jira integration yet. In future, I would love to see integration with more issue trackers like Trac.</span></p>
<p><span><strong>Error Reporting<br />
</strong>Another neat feature which I like in this release is the enhancements made to the exception reporter.<br />
In previous versions of NetBeans, the issue log file shall be uploaded to the netbeans server and you will be displayed a message in the browser regarding the status of the issue. Now that&#8217;s integrated into the IDE as well.</span></p>
<p><span><strong><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/Screenshot10a.png" alt="" /></strong></span></p>
<p><span><strong></strong>You can view all the issues filed by you by clicking the button &#8220;Show my issues&#8221;. </span></p>
<p><span><strong><img style="max-width: 800px;" src="http://solitarygeek.com/blog/wp-content/uploads/2009/07/Screenshot11a.png" alt="" /><br />
</strong><br />
<strong>Others</strong></span></p>
<p><span><strong></strong>Other highlighed feature of NetBeans is &#8220;Project Kenai&#8221; integration. For those who are wondering what is this all about, &#8220;Project Kenai&#8221; is a place to host your open source projects much like sourceforge, google code, launchpad etc. But I couldn&#8217;t complete my testing on this NetBeans feature and as such I couldn&#8217;t write about this at this point of time. But to be frank, I&#8217;m not very excited about this feature. A sourceforge.net integration would have made me much happier but nevertheless it&#8217;s a great effort put forward by NetBeans team.</span></p>
<p><span>There are many other improvements in the areas of code completion, debugging, profiling, Maven support, Groovy support etc. You can get more details about that from the <a href="http://wiki.netbeans.org/NewAndNoteWorthyNB67">netbeans wiki</a>.</span></p>
<p><span><strong>Summary<br />
</strong>Overall, NetBeans 6.7 builds on the strong platform of 6.x series and takes team development one step further. Hudson integration is really very good and I believe Bugzilla integration is also pretty good. But there are not many new features in this release that can make a Java developer happy. Whatsoever, it&#8217;s a great effort from the NetBeans team and we must appreciate them for this solid work. So what about you? Have you tried NetBeans 6.7? How do you feel about it?</span></p>
<p><span><strong>New!</strong></span></p>
<p><span>Learn more about Hudson from the blog post <a href="http://www.solitarygeek.com/java/hudson-ci-server-a-step-by-step-guide-part-i/">Hudson CI Server &#8211; A step by step guide &#8211; Part I</a>.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/netbeans-6-7-a-quick-glance/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Ubuntu 8.10 &#8211; A Productive Java Development Environment</title>
		<link>http://solitarygeek.com/java/ubuntu-810-a-productive-java-development-environment</link>
		<comments>http://solitarygeek.com/java/ubuntu-810-a-productive-java-development-environment#comments</comments>
		<pubDate>Sat, 13 Dec 2008 00:42:58 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu-8.10]]></category>

		<guid isPermaLink="false">http://jamesselvakumar.wordpress.com/2008/12/13/ubuntu-810-a-productive-java-development-environment/</guid>
		<description><![CDATA[<p>I recently started using Ubuntu 8.10 at my workplace as well. Till then, I have been using Ubuntu only at home. For me, Ubuntu@Work was very different from Ubuntu@Home. I mostly surf, blog, listen to music and play some games at home. But Ubuntu@Work was a completely different scenario.</p>
<p>Since I&#8217;m new to this linux stuff, it <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/ubuntu-810-a-productive-java-development-environment">Ubuntu 8.10 &#8211; A Productive Java Development Environment</a></span>]]></description>
			<content:encoded><![CDATA[<p>I recently started using Ubuntu 8.10 at my workplace as well. Till then, I have been using Ubuntu only at home. For me, <a href="http://jamesselvakumar.wordpress.com/2008/12/09/ubuntuwork-finally/">Ubuntu@Work</a> was very different from Ubuntu@Home. I mostly surf, blog, listen to music and play some games at home. But Ubuntu@Work was a completely different scenario.</p>
<p>Since I&#8217;m new to this linux stuff, it took me some time to configure things like static ip address, host names etc. But once everything was setup, things started moving quickly. I initially had doubt in my minds about the font rendering of NetBeans (or any swing app for that matter) under linux. I even wrote an post showing <a href="http://jamesselvakumar.wordpress.com/2008/02/08/eclipse-vs-netbeans-again-on-ubuntu/">my frustration with NetBeans</a> font rendering when compared to Eclipse. But with jdk.1.6.10, font rendering is smooth and NetBeans works like a champ! You can see some samples here:</p>
<p><span id="more-231"></span></p>
<p><img style="max-width:800px;" src="http://farm4.static.flickr.com/3248/3103507233_f0c70aa359_o.png" /></p>
<p><img style="max-width:800px;" src="http://farm4.static.flickr.com/3061/3103507237_37c423d08e_o.png" /></p>
<p><img style="max-width:800px;" src="http://farm4.static.flickr.com/3041/3103507231_567dfe1c74_o.png" /></p>
<p>But not everything is perfect at this point of time. For example, the combo boxes are not rendered properly. But apart from these minor glitches, NetBeans runs very well on Ubuntu.</p>
<p>I initially thought of using my already existing netbeans projects in a ntfs partition. But later, I decided not to go for it. I thought working on a native &#8220;ext3&#8243; partition would give better performance and I can say that I&#8217;m not disappointed.</p>
<p>With my projects in a &#8220;ext3&#8243; filesystem, opening projects and editing files are faster now. And with excellent subversion integration, working as a diverse team is not at all an issue. (I&#8217;m the only one using Ubuntu in my team so far. <img src='http://solitarygeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</p>
<p>So far, I have been doing Java development on a Windows XP machine and I can say with absolute confidence that Ubuntu offers a much more better development environment. I can connect to other Windows machines in my network using &#8220;Terminal Server Client&#8221; which comes with the default Ubuntu installation. Yes you can argue that Windows has &#8220;Remote Desktop&#8221; by default as well. But Ubuntu supports not just &#8220;remote desktop&#8221; but also &#8220;VNC&#8221; by default. With VNC, I can connect to linux servers and other old windows machines (2000, NT).</p>
<p><img style="max-width:800px;" src="http://farm4.static.flickr.com/3235/3103507245_3da06cc40b_o.png" /></p>
<p>Just in case if you want to connect to that old operating system, it&#8217;s very easy with Ubuntu on your side <img src='http://solitarygeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><img style="max-width:800px;" src="http://farm4.static.flickr.com/3248/3104495152_afc0be08b8_o.png" /></p>
<p><img style="max-width:800px;" src="http://farm4.static.flickr.com/3018/3104495156_920eb61a15_o.png" /></p>
<p>And I use to depend heavily on WinSCP to share files between computers but I was stunned to see Ubuntu providing native support to ssh which is integrated into the nautilus file explorer as well. This feature alone saves me a lot of time!</p>
<p><img style="max-width:800px;" src="http://farm4.static.flickr.com/3088/3103507239_6c91b5df48_o.png" /></p>
<p>What more, you get a powerful &#8220;Network Tools&#8221; which can do some simple operations like &#8220;ping&#8221; to scanning for opened ports in a remote computer. </p>
<p><img style="max-width:800px;" src="http://farm4.static.flickr.com/3157/3103633047_46f291c5dd_o.png" /></p>
<p><img style="max-width:800px;" src="http://farm4.static.flickr.com/3256/3103633049_8a624297c7.jpg?v=0" /></p>
<p>There is an excellent partition editor as well in the form of &#8220;GParted&#8221; with which you can easily resize/create/delete/format partitions. I use this to manage partitions even in windows machines. </p>
<p><img style="max-width:800px;" src="http://farm4.static.flickr.com/3024/3089055755_7bd50675a6_o.png" height="266" width="700" /></p>
<p>Remember that crappy &#8220;Disk Management&#8221; tool in Windows?. Yes there are tools like Partition Magic for Windows, but in Ubuntu, all these things are available by default and costs absolutely nothing.</p>
<p>Moreover, boot up and shutdown are very fast with Ubuntu 8.10 than with Windows XP. The OS itself consumes much less memory, so other applications get more resources. Especially when you have a system with minimal configuration, then Ubuntu Linux is definitely a better option than Windows.</p>
<p>Setting up a fresh system with Windows XP + drivers + other softwares normally take more than 2 hours but setting up a similar system with Ubuntu will take less than half an hour. And do I need to say that a default Ubuntu installation comes with softwares like Firefox, Pidgin, OpenOffice, GIMP etc. And you can find most of your favourite software in the Synaptic Package Manager. You will enjoy installing softwares like Picasa, Google Earth, Skype etc from within your operating system. No need to go to 101 sites to download 101 stuff!</p>
<p>And kindly note that Ubuntu Linux is not the only option you have. There are many other great Linux distros like Fedora, Linux Mint, OpenSuse etc. Since I use Ubuntu at work/home, I shared my views based on Ubuntu. I just installed <a href="http://linuxmint.com/">Linux Mint</a> for my wife which looks like a drop-in replacement for Windows. (Actually she couldn&#8217;t believe that it&#8217;s linux for quite some time)</p>
<p>With it&#8217;s excellent performance even on old hardware and with lots of bundled software tools which boosts productivity, Ubuntu certainly provides excellent environment for development. Add NetBeans/Eclipse/Intellij IDEA to this and you get a powerful java development environment that will cost you less and provide more value for your money/hardware.</p>
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/ubuntu-810-a-productive-java-development-environment/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Subversion and NetBeans &#8211; A quick start guide</title>
		<link>http://solitarygeek.com/java/subversion-and-netbeans-a-quick-start-guide</link>
		<comments>http://solitarygeek.com/java/subversion-and-netbeans-a-quick-start-guide#comments</comments>
		<pubDate>Mon, 07 Apr 2008 02:24:10 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://jamesselvakumar.wordpress.com/?p=49</guid>
		<description><![CDATA[<p>Introduction:</p>
<p>Subversion is arguably the most popular version control system as of now. No wonder NetBeans has very good support for Subversion. I personally feel that a java developer must be familiar with both these tools. This article shall help you to get started with both these tools.</p>
<p>Objectives: </p>
<p>- To create a simple java project in NetBeans.</p>
<p>- <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/subversion-and-netbeans-a-quick-start-guide">Subversion and NetBeans &#8211; A quick start guide</a></span>]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction:</strong></p>
<p>Subversion is arguably the most popular version control system as of now. No wonder NetBeans has very good support for Subversion. I personally feel that a java developer must be familiar with both these tools. This article shall help you to get started with both these tools.</p>
<p><strong>Objectives: </strong></p>
<p>- To create a simple java project in NetBeans.</p>
<p>- To import the java project into the subversion repository.</p>
<p>- To commit the changes made in a java source file.</p>
<p>- To view the revision history of a java source file which was changed.</p>
<p>- To rollback to the previous revision of the java source file.</p>
<p><span id="more-186"></span><strong>Requirements:</strong></p>
<p>- NetBeans 6.1 Beta or NetBeans 6.0</p>
<p>- Subversion</p>
<p>- TortoiseSVN</p>
<p>- Though not mandatory, but a basic knowledge of subversion concepts.</p>
<p>Note: You can read this <a href="http://www.solitarygeek.com/version-control/extending-subversion-by-using-tortoisesvn/">article</a> to learn how to install/configure Subversion and TortoiseSVN.</p>
<p><strong> Step 1:</strong></p>
<p>Create a new &#8220;Java Application&#8221; project called &#8220;SimpleLogin&#8221;.</p>
<p><img src="http://farm3.static.flickr.com/2285/2354391015_e8070fe6c2.jpg?v=0" alt="" width="320" height="205" /></p>
<p><strong>Step 2:</strong></p>
<p>Create a new JFrame called &#8220;LoginFrame&#8221; under the package &#8220;org.example.simplelogin&#8221; and add the necessary components as shown below.</p>
<p><img src="http://farm4.static.flickr.com/3246/2355221082_2e9b59379e.jpg?v=0" alt="" width="389" height="319" /></p>
<p><strong>Step 3:</strong></p>
<p>Name the swing components accordingly.</p>
<p><img src="http://farm3.static.flickr.com/2092/2354399601_5e9845018a.jpg?v=0" alt="" width="316" height="214" /></p>
<p>Your application should like this now on preview:</p>
<p><img src="http://farm4.static.flickr.com/3224/2354366319_b5dac51760.jpg?v=0" alt="" width="368" height="236" /></p>
<p><strong> Step 4:</strong></p>
<p>Create a java class named &#8220;LoginService&#8221; under the package &#8220;org.example.simplelogin&#8221;.</p>
<p><img src="http://farm3.static.flickr.com/2370/2354421741_398aa583b0.jpg?v=0" alt="" width="209" height="127" /></p>
<p><strong>Step 5:</strong></p>
<p>Add the following code to the LoginService class.</p>
<p><img src="http://farm4.static.flickr.com/3032/2354421803_83e0994905.jpg?v=0" alt="" width="500" height="289" /></p>
<p>Here we are defining a simple method which shall return true if the username is &#8220;guest&#8221; and the password is &#8220;password&#8221;.</p>
<p>[smartads]</p>
<p><strong>Step 6:</strong></p>
<p>Now open &#8220;LoginFrame.java&#8221; and add the following methods.</p>
<p><img src="http://farm3.static.flickr.com/2285/2354439587_93693668f4.jpg?v=0" alt="" width="500" height="379" /></p>
<p>The above methods are self explanatory. We are just doing a simple validation and calling the login method we defined previously in the class LoginService.</p>
<p><strong>Step 7:</strong></p>
<p>Now double click the login &#8220;button&#8221; in the design mode of LoginFrame.java to create the event handling method named &#8220;loginButtonActionPerformed&#8221;. Add the following code to call the &#8220;performLogin&#8221; method.</p>
<p><img src="http://farm4.static.flickr.com/3248/2355269808_59b4391e3f.jpg?v=0" alt="" width="500" height="146" /></p>
<p>That&#8217;s it.</p>
<p><strong>Step 8:</strong></p>
<p>Run the project.</p>
<p>If you enter the username as &#8220;guest&#8221; and password as &#8220;password&#8221;, you will get an output like this.</p>
<p><img src="http://farm4.static.flickr.com/3230/2355196504_9173f89f63.jpg?v=0" alt="" width="392" height="241" /></p>
<p>Otherwise, you will be getting an output like this.</p>
<p><img src="http://farm3.static.flickr.com/2001/2354366847_faebc87abf.jpg?v=0" alt="" width="393" height="242" /></p>
<p>Ok, our simple login application is ready for prime time <img src='http://solitarygeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Now let us import this project into a subversion repository.</p>
<p><strong>Step 9:</strong></p>
<p>Create an empty folder called &#8220;MyRepository&#8221; in a preferred location.</p>
<p><img src="http://farm3.static.flickr.com/2158/2332675889_afaca8cb2b.jpg?v=0" alt="" width="390" height="435" /></p>
<p><strong>Step 10:</strong></p>
<p>Create a subversion repository in the empty &#8220;MyRepository&#8221; folder as mentioned below, by right clicking anywhere inside the windows explorer.</p>
<p><img src="http://farm3.static.flickr.com/2240/2333503938_c0cc41b66b.jpg?v=0" alt="" width="376" height="342" /></p>
<p>Accept the default option (FSFS)  in the &#8220;Create Repository&#8221; window.</p>
<p><img src="http://farm4.static.flickr.com/3039/2332675945_2ef1cf39a5.jpg?v=0" alt="" width="285" height="178" /></p>
<p>That&#8217;s it. Your repository should be ready when you press &#8220;OK&#8221; and it should look something like this.</p>
<p><img src="http://farm4.static.flickr.com/3136/2333503978_2f67050339.jpg?v=0" alt="" width="367" height="276" /></p>
<p><strong>Step 11:</strong></p>
<p>Let us import the NetBeans project we have created into the subversion repository. Right click the NetBeans project we have created and then click &#8220;Versioning -&gt; Import into Subversion Repository&#8221;.</p>
<p><img src="http://farm4.static.flickr.com/3227/2354370051_a1bb1babc9.jpg?v=0" alt="" width="450" height="500" /></p>
<p>NetBeans will prompt you with a window. Enter the path of your repository as shown below.</p>
<p><img src="http://farm4.static.flickr.com/3131/2354366929_c0b9e131fc.jpg?v=0" alt="" width="500" height="363" /></p>
<p>Click the &#8220;Next&#8221; button and enter the &#8220;Repository Folder&#8221; name into which you would like to import your project. To make things simple, let us enter our NetBeans project name itself as the &#8220;Repository Folder&#8221; name. Also enter a small description about this import activity as shown below.<br />
<img src="http://farm4.static.flickr.com/3190/2354367351_3b774a4fe0.jpg?v=0" alt="" width="500" height="363" /></p>
<p>We are almost there. Click the &#8220;Next&#8221; button and the IDE will show a window like this.</p>
<p><img src="http://farm3.static.flickr.com/2360/2354367443_e95904ec06.jpg?v=0" alt="" width="500" height="363" /></p>
<p>Accept the default entries and click &#8220;Finish&#8221;. Congratulations! you have imported your project successfully into the subversion repository.</p>
<p>Right click anywhere in your desktop/windows explorer and click &#8220;TortoiseSVN -&gt; Repo-Browser&#8221; and then enter the path of your subversion repository. You can see all your project files sitting comfortably inside the subversion repository. <img src='http://solitarygeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><img src="http://farm3.static.flickr.com/2380/2354367493_f3d0a11d7e.jpg?v=0" alt="" width="500" height="385" /></p>
<p><strong>Step 12:</strong></p>
<p>Let us play around with some more cool subversion integration features offered by NetBeans. Open the class &#8220;LoginService.java&#8221; and change the value of &#8220;DUMMY_PASSWORD&#8221; from &#8220;password&#8221; to &#8220;guest&#8221;.</p>
<p><img src="http://farm3.static.flickr.com/2279/2354367625_3451f147bb.jpg?v=0" alt="" width="488" height="132" /></p>
<p>You can see the IDE markup a blue shade near the line you made the change. This indicates that your source file has got something different than the version in the repository. You can also note that the IDE change your java source file name&#8217;s font-color to blue.</p>
<p><img src="http://farm3.static.flickr.com/2100/2355197270_23d115a77c.jpg?v=0" alt="" width="211" height="169" /></p>
<p>Let us turn our focus to the editor window again. Click the blue stripe shown by the IDE near the  place where you made changes to the source file. The IDE will popup a small hint-window.</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2306/2355199812_f99bab7f3d.jpg?v=0" alt="screenshot" /></p>
<p>You can see the previous value of the DUMMY_PASSWORD there. The IDE also provides you a set of buttons to revert back the changes or to have a &#8220;diff&#8221; view on the changes made. Let us explore the &#8220;diff&#8217; functionality of the IDE first by clicking the &#8220;diff&#8221; button.</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2087/2354370155_6d7e54a8b8.jpg?v=0" alt="screenshot" /></p>
<p>The IDE will display the &#8220;diff&#8221; view of the &#8220;working copy&#8221; and the &#8220;HEAD&#8221; revision (the latest committed version) in the repository.</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2345/2355198438_3bd7fbf264.jpg?v=0" alt="screenshot" /></p>
<p>From the above figure, you can see the current and previous value of the string DUMMY_PASSWORD. Now you can revert back to the old value of &#8220;DUMMY_PASSWORD&#8221; by clicking the replace  button (displayed like an arrow)</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2351/2354368671_662f937baa.jpg?v=0" alt="screenshot" /></p>
<p>When you press the &#8220;replace&#8221; button, the IDE will replace the &#8220;current&#8221; value with the &#8220;original&#8221; value.</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2190/2354369007_61c4845791.jpg?v=0" alt="screenshot" /></p>
<p>The &#8220;diff&#8221; view provided by the IDE will be very useful to examine and compare the changes made to the &#8220;working copy&#8221;  alongwith the option to revert back to the original version in the repository. But if all you need is to quickly revert back some change to the original version in the repository, you can click on the blue strip in the source code and click the &#8220;revert&#8221; button.</p>
<p><img class="alignnone" src="http://farm4.static.flickr.com/3166/2354370183_f78490efc2.jpg?v=0" alt="screenshot" /></p>
<p>That&#8217;s cool, right?</p>
<p><strong>Step 13:</strong></p>
<p>Enough playing. Now let us commit the changes we made in our source file. Ensure that the source file you are willing to commit is in focus and click the menu &#8220;Versioning -&gt; Commit&#8221;</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2172/2354369307_0be03de170.jpg?v=0" alt="screenshot" /></p>
<p>When you click the &#8220;Commit&#8221; menu item, the IDE will prompt you with a window to enter the &#8220;message&#8221; for this commit operation. Enter a commit message and click the &#8220;Commit&#8221; button.</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2318/2355199090_2c2ae15907.jpg?v=0" alt="screenshot" /></p>
<p><strong>Step 14:</strong></p>
<p>Let us explore the history of our source file and see the the changes we made all along. Click the &#8220;Versioning -&gt; Search History&#8221; menu.</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2069/2354369489_750d96fbe5.jpg?v=0" alt="screenshot" /></p>
<p>The IDE will display all the versions of the source file.</p>
<p><img class="alignnone" src="http://farm4.static.flickr.com/3114/2355199460_9c845473d6.jpg?v=0" alt="screenshot" /></p>
<p>In the &#8220;Search History&#8221; window, the IDE offers two views, &#8220;summary&#8221; view and &#8220;diff&#8221; view. By default, the IDE displays the &#8220;summary&#8221; view. The &#8220;diff&#8221; view contains more information.</p>
<p><img class="alignnone" src="http://farm4.static.flickr.com/3179/2354369639_4956351bea.jpg?v=0" alt="screenshot" /></p>
<p>You can straightaway &#8220;revert&#8221; or &#8220;rollback&#8221; to previous revisions just by right clicking a particular revision.</p>
<p><img class="alignnone" src="http://farm4.static.flickr.com/3274/2354370017_5f7832e150.jpg?v=0" alt="screenshot" /></p>
<p>Nice, isn&#8217;t it? There are still a lot more cool subversion features offered by NetBeans. I will blog more about that later. I hope the information provided here was useful to you.</p>
<p><strong>SolitaryGeek Poll</strong></p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/subversion-and-netbeans-a-quick-start-guide/feed</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Must have tools for a Java Developer</title>
		<link>http://solitarygeek.com/java/must-have-tools-for-a-java-developer</link>
		<comments>http://solitarygeek.com/java/must-have-tools-for-a-java-developer#comments</comments>
		<pubDate>Wed, 19 Mar 2008 07:54:20 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://jamesselvakumar.wordpress.com/?p=48</guid>
		<description><![CDATA[<p>Apart from your favourite IDE, I feel, a Java Developer might be very productive with the following tools (in no particular order):</p>
<p>- Firefox (Do I need to say anything about it?)</p>
<p>- Apache Ant (Not needed, if you use NetBeans. NetBeans has got bundled ant)</p>
<p>-  JEdit (Mainly for it&#8217;s wide range of plugins. I use it&#8217;s <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/must-have-tools-for-a-java-developer">Must have tools for a Java Developer</a></span>]]></description>
			<content:encoded><![CDATA[<p>Apart from your favourite IDE, I feel, a Java Developer might be very productive with the following tools (in no particular order):</p>
<p>- <a href="http://www.mozilla.com/en-US/firefox/"><b>Firefox</b></a> (Do I need to say anything about it?)</p>
<p>- <a href="http://ant.apache.org/"><b>Apache Ant</b></a> (Not needed, if you use NetBeans. NetBeans has got bundled ant)</p>
<p>-  <a href="http://www.jedit.org/"><b>JEdit</b></a> (Mainly for it&#8217;s wide range of plugins. I use it&#8217;s LogViewer and HexViewer plugin frequently. Also it has got excellent syntax highlighting for your properties file, java files, nsis scripts etc)</p>
<p>- <b><a href="http://subversion.tigris.org/">Subversion</a> </b>Version Control System(Got excellent integration with NetBeans and Eclipse. You must consider it atleast for your personal development.) You can read more about installing subversion <a href="http://jamesselvakumar.wordpress.com/2008/03/14/extending-subversion-by-using-tortoisesvn/">here</a>.</p>
<p><span id="more-185"></span>- <a href="http://tomcat.apache.org/"><b>Apache Tomcat</b></a> (The ubiquitous servlet container.)</p>
<p>- <a href="https://glassfish.dev.java.net//"> <b>Glassfish</b></a> (The best open source application server, at the moment. Thanks RedHat for making JBoss AS development sluggish. JBoss AS users are waiting for nearly 1 1/2 years for the 5.0 release.)</p>
<p>- <a href="https://hudson.dev.java.net/"><b>Hudson</b></a> (The fastest growing continuous integration server. This can be an excellent add-on to your ant/maven based build process). You can read more about hudson <a href="http://jamesselvakumar.wordpress.com/2008/03/07/continuous-integration-with-hudson/">here</a>.</p>
<p>-  <a href="http://wrapper.tanukisoftware.org/doc/english/introduction.html"><b>Java Service Wrapper</b></a> (An excellent product to launch your java applications as a windows service)</p>
<p>- <b><a href="http://checkstyle.sourceforge.net/">CheckStyle</a>/<a href="http://pmd.sourceforge.net/">PMD</a></b> (Excellent code coverage tools to make your source code more maintainable)</p>
<p>- <a href="http://www.jasypt.org/"><b>JASYPT</b></a> (Excellent cryptography library to encrypt/decrypt your passwords, files etc.)</p>
<p>- <b><a href="http://commons.apache.org/">Apache Commons Library</a></b> (Contains almost all the utility classes you will ever need. Kindly check this project before writing your own utility classes)</p>
<p>- <b><a href="http://jude.change-vision.com/jude-web/product/community.html">JUDE Community</a></b> (An excellent free UML modelling tool. You must definitely give it a try. It&#8217;s lightweight and it&#8217;s very simple to use.)</p>
<p>- <b><a href="http://www.mysql.com/">MySQL</a></b> (The most popular open source database at the moment)</p>
<p>Did anybody say that I forgot to add <a href="http://www.google.com"><b>Google</b></a> as well <img src='http://solitarygeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>What else do you use? It will be of great use to the community if you can share about your experience as well.</p>
<p><i>Note:</i> I tend not to include frameworks like Spring, JSF, Wicket etc.. Because you can see these frameworks too are highly subjective and a major reason for lots of flamewars. And that&#8217;s the reason why I didn&#8217;t mention any IDE as well. Whatever IDE or framework you use, it&#8217;s very likely that you might need the above mentioned &#8220;tools&#8221; except a few like database/application server, whose choice are mostly defined by a particular organization.</p>
<p>You should read this article in the perspective of &#8220;tools needed for your personal java development&#8221;. Because there are &#8220;lots&#8221; of factors involved in your work environment regarding the selection of tools.</p>
<p>And lastly, this is my humble suggestion only. So if you find your favourite tool missing, don&#8217;t get panic. Cheers&#8230; <img src='http://solitarygeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/must-have-tools-for-a-java-developer/feed</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Connecting to a database from a java web application</title>
		<link>http://solitarygeek.com/java/connecting-to-a-database-from-a-java-web-application</link>
		<comments>http://solitarygeek.com/java/connecting-to-a-database-from-a-java-web-application#comments</comments>
		<pubDate>Wed, 12 Mar 2008 17:14:02 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://jamesselvakumar.wordpress.com/?p=44</guid>
		<description><![CDATA[<p>In these days of numerous java frameworks, we often forget or don&#8217;t care about some simple things. Though this post might not be very interesting to most of you, it might help some of those to whom this might be the information they are looking for. So bear with me.</p>
<p> Pre-requisites:</p>
<p>- Latest version of Tomcat (currently <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/connecting-to-a-database-from-a-java-web-application">Connecting to a database from a java web application</a></span>]]></description>
			<content:encoded><![CDATA[<p>In these days of numerous java frameworks, we often forget or don&#8217;t care about some simple things. Though this post might not be very interesting to most of you, it might help some of those to whom this might be the information they are looking for. So bear with me.</p>
<p><strong> Pre-requisites:</strong></p>
<p>- Latest version of Tomcat (currently 6.0.16)</p>
<p>- A database <img src='http://solitarygeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  (In my case, it&#8217;s mysql 5.0)</p>
<p>- Appropriate jdbc &#8220;driver&#8221; jar file for your database. (In my case, it&#8217;s mysql jdbc driverr)</p>
<p><span id="more-181"></span><strong>Step 1:</strong></p>
<p>- Copy the &#8220;jdbc driver&#8221; jar file to the TOMCAT_HOME/lib directory.  (Usually, C:\Program Files\Apache Software Foundation\Tomcat 6.0.x\lib)</p>
<p>[smartads]</p>
<p><strong>Step 2:</strong></p>
<p>- Open the &#8220;context.xml&#8221; file of your web application. It can be found under META-INF directory in your web app.</p>
<p>- Your context.xml file might look something like this, initially:</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;Context path=&#8221;/CrickBoss-JSF&#8221;/&gt;<br />
<strong>Step 3:</strong></p>
<p>- Update your context.xml to register your &#8220;jdbc driver&#8221;, like this:</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;Context path=&#8221;/CrickBoss-JSF&#8221;&gt;<br />
&lt;Resource name=&#8221;jdbc/CrickBossDB&#8221; auth=&#8221;Container&#8221;<br />
type=&#8221;javax.sql.DataSource&#8221; username=&#8221;root&#8221; password=&#8221;mypassword&#8221;<br />
driverClassName=&#8221;com.mysql.jdbc.Driver&#8221;<br />
url=&#8221;jdbc:mysql://127.0.0.1:3306/CrickBossDB&#8221;<br />
maxActive=&#8221;8&#8243; maxIdle=&#8221;4&#8243;/&gt;<br />
&lt;/Context&gt;</p>
<p>Things to note here:</p>
<p>- Give appropriate resource name for your datasource. In my case, it&#8217;s <strong>&#8220;jdbc/CrickBossDB&#8221; .</strong></p>
<p>- Use appropriate username and password with respect to your database.</p>
<p>- Provide appropriate driver name in the driverClassName attribute. In my case, it&#8217;s <strong>&#8220;com.mysql.jdbc.Driver&#8221;</strong></p>
<p>- Enter your database url correctly. In my case, it&#8217;s <strong>&#8220;jdbc:mysql://127.0.0.1:3306/CrickBossDB&#8221;</strong></p>
<p>(Note: Refer your database driver&#8217;s documentation to find out the jdbc url. Microsoft SQL Server, for example, expects the string &#8220;databaseName&#8221; in the jdbc url.)</p>
<p>Don&#8217;t worry about other settings. You need not change it at this point of time.</p>
<p><strong>Step 4:</strong></p>
<p>- Register the jdbc datasource in &#8220;web.xml&#8221;. (This file is located under &#8220;WEB-INF&#8221; directory.), by adding the following code:</p>
<p>&lt;resource-ref&gt;<br />
&lt;res-ref-name&gt;jdbc/CrickBossDB&lt;/res-ref-name&gt;<br />
&lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;<br />
&lt;res-auth&gt;Container&lt;/res-auth&gt;<br />
&lt;/resource-ref&gt;</p>
<p><em>Note:</em></p>
<p>Give your datasource name in &lt;res-ref-name&gt; as defined in your context.xml. In my case, it&#8217;s <strong>&#8220;jdbc/CrickBossDB&#8221;</strong></p>
<p><strong>Step 5:</strong></p>
<p>We are almost there. It&#8217;s now time to use all the configurations we have made.</p>
<p>Now lookup the jdbc datasource we have defined from your servlet, like this:</p>
<p><em>InitialContext context = new InitialContext();<br />
DataSource dataSource = (DataSource) context.lookup(&#8220;java:/comp/env/jdbc/CrickBossDB&#8221;);</em></p>
<p>Once you get the datasource, creating a connection is a piece of cake.</p>
<p><em>Connection connection = dataSource.getConnection();</em></p>
<p>That&#8217;s it. Now it&#8217;s up to you to use this connection and execute some queries.</p>
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/connecting-to-a-database-from-a-java-web-application/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
