<?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>vincentkong.com &#187; Java</title>
	<atom:link href="http://www.vincentkong.com/tag/java/feed" rel="self" type="application/rss+xml" />
	<link>https://www.vincentkong.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 07 Jul 2010 00:32:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>NekoBean Paper Craft</title>
		<link>https://www.vincentkong.com/2010/01/nekobean-paper-craft</link>
		<comments>https://www.vincentkong.com/2010/01/nekobean-paper-craft#comments</comments>
		<pubDate>Wed, 27 Jan 2010 02:46:19 +0000</pubDate>
		<dc:creator>Vincent Kong</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[NekoBean]]></category>
		<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://www.vincentkong.com/?p=1494</guid>
		<description><![CDATA[A few weeks ago, I stumbled on a paper craft template of NekoBean on the nekobean.net website.  The last time I did any art and craft was in junior public school, so I definitely didn&#8217;t have the talent for this kind of work. I printed a few copies using the laser printer at work, and [...]


Related posts:<ol><li><a href='https://www.vincentkong.com/2008/11/problem-using-mysql-jdbc-on-tomcat-55-and-ubuntu-804' rel='bookmark' title='Permanent Link: Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04'>Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04</a></li>
<li><a href='https://www.vincentkong.com/2007/06/setting-default-jvm-in-ubuntu' rel='bookmark' title='Permanent Link: Setting Default JVM in Ubuntu'>Setting Default JVM in Ubuntu</a></li>
<li><a href='https://www.vincentkong.com/2008/01/problems-with-ubuntu-710-and-tomcat-55' rel='bookmark' title='Permanent Link: Problems with Ubuntu 7.10 and Tomcat 5.5'>Problems with Ubuntu 7.10 and Tomcat 5.5</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, I stumbled on a paper craft template of <a href="http://www.vincentkong.com/wp-content/uploads/2010/01/nekobean.pdf">NekoBean</a> on the <a href="http://nekobean.net/2009/12/post-20.html">nekobean.net</a> website.  The last time I did any art and craft was in junior public school, so I definitely didn&#8217;t have the talent for this kind of work.</p>
<p>I printed a few copies using the laser printer at work, and went to work using some white glue and a pair of scissors.</p>
<p>After a few failed attempts and numerous hours I finally put it together!</p>
<div class="wp-caption aligncenter" style="width: 160px"><a href="http://gallery.vincentkong.com/20100126_nekobean_paper_craft/"><img title="NekoBean Paper Craft" src="http://gallery.vincentkong.com/12342-4/20100126_nekobean_paper_craft.jpg" alt="" width="150" height="113" /></a><p class="wp-caption-text">NekoBean Paper Craft</p></div>
<h4>For readers who aren&#8217;t geeks&#8230;</h4>
<p><em><strong>What is NekoBean?</strong></em> <a href="http://ja.netbeans.org/nekobean/index.html">NekoBean</a> is the mascot for <a href="http://www.netbeans.org">NetBeans</a> introduced by the <a href="http://ja.netbeans.org/">NetBeans Japanese Speaking Community</a> in Mar 2008.  The actual author is <a href="http://blog.cgfm.jp/mutsuki/">Mutsuki san</a> who seems to be a very talented designer.   The mascot is derived from a cat (&#8220;Neko&#8221; means &#8220;cat&#8221; in Japanese), and the NetBeans grid/box logo.</p>
<p><em><strong>What is NetBeans?</strong></em> Without being too technical, NetBeans is a free software development tool for programming Java, and other programming languages.</p>


<p>Related posts:<ol><li><a href='https://www.vincentkong.com/2008/11/problem-using-mysql-jdbc-on-tomcat-55-and-ubuntu-804' rel='bookmark' title='Permanent Link: Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04'>Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04</a></li>
<li><a href='https://www.vincentkong.com/2007/06/setting-default-jvm-in-ubuntu' rel='bookmark' title='Permanent Link: Setting Default JVM in Ubuntu'>Setting Default JVM in Ubuntu</a></li>
<li><a href='https://www.vincentkong.com/2008/01/problems-with-ubuntu-710-and-tomcat-55' rel='bookmark' title='Permanent Link: Problems with Ubuntu 7.10 and Tomcat 5.5'>Problems with Ubuntu 7.10 and Tomcat 5.5</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>https://www.vincentkong.com/2010/01/nekobean-paper-craft/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If-Else in Ant</title>
		<link>https://www.vincentkong.com/2010/01/if-else-in-ant</link>
		<comments>https://www.vincentkong.com/2010/01/if-else-in-ant#comments</comments>
		<pubDate>Mon, 18 Jan 2010 00:59:31 +0000</pubDate>
		<dc:creator>Vincent Kong</dc:creator>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.vincentkong.com/?p=1084</guid>
		<description><![CDATA[When I need to write quick script to perform a simple task, I opt to use Ant instead of a shell script. Unfortunately, the Ant core tasks doesn&#8217;t provide any flow logic like the everyday if-else statements. Ant-Contrib provides a collection of useful tasks missing in the Ant core. Installing Ant-Contrib There are 2 methods [...]


Related posts:<ol><li><a href='https://www.vincentkong.com/2008/12/sending-email-with-ant' rel='bookmark' title='Permanent Link: Sending Email with Ant'>Sending Email with Ant</a></li>
<li><a href='https://www.vincentkong.com/2007/05/some-useful-ant-tasks' rel='bookmark' title='Permanent Link: Some Useful Ant Tasks'>Some Useful Ant Tasks</a></li>
<li><a href='https://www.vincentkong.com/2007/06/java-code-snippet-for-sending-email-using-gmail-smtp-server' rel='bookmark' title='Permanent Link: Java Code Snippet for Sending Email using Gmail SMTP Server'>Java Code Snippet for Sending Email using Gmail SMTP Server</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When I need to write quick script to perform a simple task, I opt to use <a href="http://ant.apache.org">Ant</a> instead of a shell script. Unfortunately, the Ant core tasks doesn&#8217;t provide any flow logic like the everyday if-else statements.</p>
<p><a href="http://ant-contrib.sourceforge.net">Ant-Contrib</a> provides a collection of useful tasks missing in the Ant core.</p>
<h3>Installing Ant-Contrib</h3>
<p>There are 2 methods to install ant-contrib:</p>
<p>Copy <code>ant-contrib-1.0b3.jar</code> to the <code>lib</code> directory of your Ant installation. If you want to use one of the tasks in your own project, add the lines</p>
<p><code>&lt;taskdef resource="net/sf/antcontrib/antcontrib.properties"/&gt;</code></p>
<p>Keep <code>ant-contrib-1.0b3.jar</code> in a separate location. You now have to tell Ant explicitly where to find it e.g. a <code>lib</code> directory relative to the <code>build.xml</code></p>
<p><code>&lt;taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="lib/ant-contrib-1.0b3.jar"/&gt;</code></p>
<h3>Example Using If-Else Task</h3>
<pre>&lt;if&gt;
  &lt;equals arg1="${status}" arg2="OFFLINE"/&gt;
  &lt;then&gt;
    [...]
  &lt;/then&gt;
  &lt;else&gt;
    [...]
  &lt;/else&gt;
  &lt;/if&gt;</pre>


<p>Related posts:<ol><li><a href='https://www.vincentkong.com/2008/12/sending-email-with-ant' rel='bookmark' title='Permanent Link: Sending Email with Ant'>Sending Email with Ant</a></li>
<li><a href='https://www.vincentkong.com/2007/05/some-useful-ant-tasks' rel='bookmark' title='Permanent Link: Some Useful Ant Tasks'>Some Useful Ant Tasks</a></li>
<li><a href='https://www.vincentkong.com/2007/06/java-code-snippet-for-sending-email-using-gmail-smtp-server' rel='bookmark' title='Permanent Link: Java Code Snippet for Sending Email using Gmail SMTP Server'>Java Code Snippet for Sending Email using Gmail SMTP Server</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>https://www.vincentkong.com/2010/01/if-else-in-ant/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH with a Web Browser</title>
		<link>https://www.vincentkong.com/2008/12/ssh-with-a-web-browser</link>
		<comments>https://www.vincentkong.com/2008/12/ssh-with-a-web-browser#comments</comments>
		<pubDate>Wed, 24 Dec 2008 07:32:03 +0000</pubDate>
		<dc:creator>Vincent Kong</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://wordpress.vincentkong.com/?p=121</guid>
		<description><![CDATA[A while back, I was using someone&#8217;s computer and I wanted to SSH into my server. The machine didn&#8217;t have any SSH client and I didn&#8217;t have my U3 Smart Drive with me. MindTerm is a client that implements the SSH protocols written in Java which can run as an Applet. The basic syntax for [...]


Related posts:<ol><li><a href='https://www.vincentkong.com/2007/06/setting-up-log4j-quickstart-guide' rel='bookmark' title='Permanent Link: Setting Up Log4j Quickstart Guide'>Setting Up Log4j Quickstart Guide</a></li>
<li><a href='https://www.vincentkong.com/2008/02/signing-java-applets-using-rsa-certificate' rel='bookmark' title='Permanent Link: Signing Java Applets Using RSA Certificate'>Signing Java Applets Using RSA Certificate</a></li>
<li><a href='https://www.vincentkong.com/2008/11/problem-using-mysql-jdbc-on-tomcat-55-and-ubuntu-804' rel='bookmark' title='Permanent Link: Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04'>Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A while back, I was using someone&#8217;s computer and I wanted to SSH into my server.  The machine didn&#8217;t have any SSH client and I didn&#8217;t have my <a href="http://www.vincentkong.com/2007/07/u3-and-portableapp/">U3 Smart Drive</a> with me.</p>
<p>MindTerm is a client that implements the SSH protocols written in Java which can run as an Applet.  The basic syntax for embedding the MindTerm Applet in a web page is as follows:</p>
<pre>&lt;APPLET CODE="com.mindbright.application.MindTerm.class"
      ARCHIVE="mindterm.jar" WIDTH="400" HEIGHT="400"&gt;
    &lt;PARAM NAME="cabinets" VALUE="mindterm.cab"&gt;
    &lt;PARAM NAME="sepframe" value="true"&gt;
    &lt;PARAM NAME="debug" value="true"&gt;
&lt;/APPLET&gt;</pre>
<p>Due to the Java security model, the Applet requires to be sign, otherwise it won&#8217;t run properly and throw an <code>AccessControlException</code>, as shown in the Java console.</p>
<p><a href="http://www.vincentkong.com/wp-content/uploads/2008/05/mindterm_exception.png"><img class="aligncenter size-medium wp-image-196" title="MindTerm AccessControlException" src="http://www.vincentkong.com/wp-content/uploads/2008/05/mindterm_exception-300x214.png" alt="MindTerm AccessControlException" width="300" height="214" /></a></p>
<p>For information on how to sign an Applet refer to <a title="Permanent Link to Signing Java Applets Using RSA Certificate" href="http://www.vincentkong.com/2008/02/signing-java-applets-using-rsa-certificate/">Signing Java Applets Using RSA Certificate</a>.  After the Applet has been successfully signed a pop up will appear asking to accept the digital signature, and when accepted the Applet will have permission to run properly; this can be verify with the Java console again.</p>
<p><a href="http://www.vincentkong.com/wp-content/uploads/2008/05/mindterm_signature.png"><img class="aligncenter size-medium wp-image-197" title="MindTerm Digital Signature" src="http://www.vincentkong.com/wp-content/uploads/2008/05/mindterm_signature-300x187.png" alt="MindTerm Digital Signature" width="300" height="187" /></a></p>
<p><a href="http://www.vincentkong.com/wp-content/uploads/2008/05/mindterm_granted.png"><img class="aligncenter size-medium wp-image-198" title="MindTerm Granted Permission" src="http://www.vincentkong.com/wp-content/uploads/2008/05/mindterm_granted-300x271.png" alt="MindTerm Granted Permission" width="300" height="271" /></a></p>
<p>Now you can SSH from any computer that has a web browser and internet access.</p>
<p><a href="http://www.vincentkong.com/wp-content/uploads/2008/05/mindterm_console.png"><img class="aligncenter size-medium wp-image-199" title="MindTerm Applet" src="http://www.vincentkong.com/wp-content/uploads/2008/05/mindterm_console-300x236.png" alt="MindTerm Applet" width="300" height="236" /></a></p>
<p>For more information refer to <a href="http://www.mindbright.com/products/80_MindTerm/50_Running_MindTerm/">Running MindTerm as an Applet</a></p>


<p>Related posts:<ol><li><a href='https://www.vincentkong.com/2007/06/setting-up-log4j-quickstart-guide' rel='bookmark' title='Permanent Link: Setting Up Log4j Quickstart Guide'>Setting Up Log4j Quickstart Guide</a></li>
<li><a href='https://www.vincentkong.com/2008/02/signing-java-applets-using-rsa-certificate' rel='bookmark' title='Permanent Link: Signing Java Applets Using RSA Certificate'>Signing Java Applets Using RSA Certificate</a></li>
<li><a href='https://www.vincentkong.com/2008/11/problem-using-mysql-jdbc-on-tomcat-55-and-ubuntu-804' rel='bookmark' title='Permanent Link: Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04'>Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>https://www.vincentkong.com/2008/12/ssh-with-a-web-browser/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sending Email with Ant</title>
		<link>https://www.vincentkong.com/2008/12/sending-email-with-ant</link>
		<comments>https://www.vincentkong.com/2008/12/sending-email-with-ant#comments</comments>
		<pubDate>Tue, 16 Dec 2008 02:19:44 +0000</pubDate>
		<dc:creator>Vincent Kong</dc:creator>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.vincentkong.com/?p=205</guid>
		<description><![CDATA[Sometimes it&#8217;s useful for an Ant script to send out an email. This can be easily done using the mail task which is part of the Core Tasks in Ant. Before using the mail task, the JavaBean Activiation Framework jar file (activation.jar), and JavaMail jar file (mail.jar) needs to be copied into the Ant lib [...]


Related posts:<ol><li><a href='https://www.vincentkong.com/2007/06/java-code-snippet-for-sending-email-using-gmail-smtp-server' rel='bookmark' title='Permanent Link: Java Code Snippet for Sending Email using Gmail SMTP Server'>Java Code Snippet for Sending Email using Gmail SMTP Server</a></li>
<li><a href='https://www.vincentkong.com/2008/11/problem-using-mysql-jdbc-on-tomcat-55-and-ubuntu-804' rel='bookmark' title='Permanent Link: Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04'>Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04</a></li>
<li><a href='https://www.vincentkong.com/2010/01/if-else-in-ant' rel='bookmark' title='Permanent Link: If-Else in Ant'>If-Else in Ant</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s useful for an Ant script to send out an email.  This can be easily done using the <code>mail</code> task which is part of the Core Tasks in Ant. Before using the <code>mail</code> task, the <a href="http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp">JavaBean Activiation Framework</a> jar file (activation.jar), and <a href="http://java.sun.com/products/javamail/index.jsp">JavaMail</a> jar file (mail.jar) needs to be copied into the Ant <code>lib</code> directory. Here is a <code>mail</code> task example which sends an email using a GMail account.</p>
<pre>&lt;target name="sendmail"&gt;
  &lt;mail
    tolist="nobody@gmail.com"
    from="nobody@gmail.com"
    subject="Email subject"
    mailhost="smtp.gmail.com"
    mailport="465"
    ssl="true"
    user="nobody@gmail.com"
    password="password"&gt;
    &lt;message&gt;Example email sent by Ant Mail task.&lt;/message&gt;
  &lt;/mail&gt;
&lt;/target&gt;</pre>
<h4>Troubleshooting Ant mail task in Ubuntu</h4>
<p><strong>Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer not found in java.net.URLClassLoader</strong></p>
<p>If you downloaded Ant from the Ubuntu packages repository, not all the core Ant tasks are available. <a href="http://www.apache.org/dist/ant/binaries/">Download</a> and extract Ant from the <a href="http://ant.apache.org/">Apache Ant</a> website.</p>
<p><code>$ wget http://www.apache.org/dist/ant/binaries/apache-ant-1.7.0-bin.tar.gz<br />
$ tar -zxvf apache-ant-1.7.0-bin.tar.gz</code></p>
<p>Copy the <code>ant-javamail.jar</code> into the <code>lib</code> directory of the Ubuntu Ant installation</p>
<p><code>$ cp ./apache-ant-1.7.0/lib/ant-javamail.jar /usr/share/ant/lib</code></p>
<p><strong>Failed to send email: could not instantiate ssl security provider, check that you have JSSE in your classpath</strong></p>
<p>If the <code>ssl</code> attribute is set to true, then the <a href="http://java.sun.com/products/archive/jsse/">Java Secure Socket Extension</a> (jsse.jar) jar file is required, which is already part of J2SE 1.4.x and later. Ubuntu uses GNU Compiler for Java (gcj) as the default JVM which doesn&#8217;t have JSSE as the part of the distribution, therefore the jsse.jar file needs to be copied into the Ant lib directory.  An alternative solution is to <a href="http://www.vincentkong.com/2007/06/setting-default-jvm-in-ubuntu/">set the default JVM</a> to use another Java distribution which already has JSSE bundled.</p>


<p>Related posts:<ol><li><a href='https://www.vincentkong.com/2007/06/java-code-snippet-for-sending-email-using-gmail-smtp-server' rel='bookmark' title='Permanent Link: Java Code Snippet for Sending Email using Gmail SMTP Server'>Java Code Snippet for Sending Email using Gmail SMTP Server</a></li>
<li><a href='https://www.vincentkong.com/2008/11/problem-using-mysql-jdbc-on-tomcat-55-and-ubuntu-804' rel='bookmark' title='Permanent Link: Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04'>Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04</a></li>
<li><a href='https://www.vincentkong.com/2010/01/if-else-in-ant' rel='bookmark' title='Permanent Link: If-Else in Ant'>If-Else in Ant</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>https://www.vincentkong.com/2008/12/sending-email-with-ant/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04</title>
		<link>https://www.vincentkong.com/2008/11/problem-using-mysql-jdbc-on-tomcat-55-and-ubuntu-804</link>
		<comments>https://www.vincentkong.com/2008/11/problem-using-mysql-jdbc-on-tomcat-55-and-ubuntu-804#comments</comments>
		<pubDate>Wed, 05 Nov 2008 03:36:39 +0000</pubDate>
		<dc:creator>Vincent Kong</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.vincentkong.com/?p=224</guid>
		<description><![CDATA[Normally when I build a web application that connects to a MySQL database, I would place the mysql-connector-java-bin.jar file into the WEB-INF/lib of the web application. However, when I deployed the application on Tomcat 5.5 on Ubuntu 8.04 I got an exception: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver I couldn&#8217;t find the reason which caused the exception, so I [...]


Related posts:<ol><li><a href='https://www.vincentkong.com/2007/10/tomcat-55-doesnt-start-in-ubuntu-710' rel='bookmark' title='Permanent Link: Tomcat 5.5 Doesn&#8217;t Start in Ubuntu 7.10'>Tomcat 5.5 Doesn&#8217;t Start in Ubuntu 7.10</a></li>
<li><a href='https://www.vincentkong.com/2007/05/mysql-for-ubuntu-quickstart-guide' rel='bookmark' title='Permanent Link: MySQL for Ubuntu Quickstart Guide'>MySQL for Ubuntu Quickstart Guide</a></li>
<li><a href='https://www.vincentkong.com/2007/05/tomcat-55-for-ubuntu-quickstart-guide' rel='bookmark' title='Permanent Link: Tomcat 5.5 for Ubuntu Quickstart Guide'>Tomcat 5.5 for Ubuntu Quickstart Guide</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Normally when I build a web application that connects to a MySQL database, I would place the <code>mysql-connector-java-bin.jar</code> file into the <code>WEB-INF/lib</code> of the web application.</p>
<p>However, when I deployed the application on Tomcat 5.5 on Ubuntu 8.04 I got an exception: <code>java.lang.ClassNotFoundException: com.mysql.jdbc.Driver</code></p>
<p>I couldn&#8217;t find the reason which caused the exception, so I did a quick fix by placing the jar file into the Tomcat&#8217;s common lib directory.</p>
<p><code>$ cp mysql-connector-java-bin.jar /usr/share/java<br />
$ cd /usr/share/tomcat5.5/common/lib<br />
$ ln -s ../../../java/mysql-connector-java-bin.jar mysql-connector-java-bin.jar</code></p>


<p>Related posts:<ol><li><a href='https://www.vincentkong.com/2007/10/tomcat-55-doesnt-start-in-ubuntu-710' rel='bookmark' title='Permanent Link: Tomcat 5.5 Doesn&#8217;t Start in Ubuntu 7.10'>Tomcat 5.5 Doesn&#8217;t Start in Ubuntu 7.10</a></li>
<li><a href='https://www.vincentkong.com/2007/05/mysql-for-ubuntu-quickstart-guide' rel='bookmark' title='Permanent Link: MySQL for Ubuntu Quickstart Guide'>MySQL for Ubuntu Quickstart Guide</a></li>
<li><a href='https://www.vincentkong.com/2007/05/tomcat-55-for-ubuntu-quickstart-guide' rel='bookmark' title='Permanent Link: Tomcat 5.5 for Ubuntu Quickstart Guide'>Tomcat 5.5 for Ubuntu Quickstart Guide</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>https://www.vincentkong.com/2008/11/problem-using-mysql-jdbc-on-tomcat-55-and-ubuntu-804/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Signing Java Applets Using RSA Certificate</title>
		<link>https://www.vincentkong.com/2008/02/signing-java-applets-using-rsa-certificate</link>
		<comments>https://www.vincentkong.com/2008/02/signing-java-applets-using-rsa-certificate#comments</comments>
		<pubDate>Tue, 19 Feb 2008 16:00:15 +0000</pubDate>
		<dc:creator>Vincent Kong</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://wordpress.vincentkong.com/?p=95</guid>
		<description><![CDATA[Generate a private/public key pair with the RSA algorithm. $ keytool -genkey -keyalg rsa -alias keyname Enter keystore password: password What is your first and last name? [Unknown]: What is the name of your organizational unit? [Unknown]: What is the name of your organization? [Unknown]: What is the name of your City or Locality? [Unknown]: [...]


Related posts:<ol><li><a href='https://www.vincentkong.com/2008/12/ssh-with-a-web-browser' rel='bookmark' title='Permanent Link: SSH with a Web Browser'>SSH with a Web Browser</a></li>
<li><a href='https://www.vincentkong.com/2007/06/java-code-snippet-for-sending-email-using-gmail-smtp-server' rel='bookmark' title='Permanent Link: Java Code Snippet for Sending Email using Gmail SMTP Server'>Java Code Snippet for Sending Email using Gmail SMTP Server</a></li>
<li><a href='https://www.vincentkong.com/2007/06/configuring-apache-for-ssl-support' rel='bookmark' title='Permanent Link: Configuring Apache for SSL Support'>Configuring Apache for SSL Support</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div id="node-106" class="node">
<div class="content">
<ol>
<li>Generate a private/public key pair with the RSA algorithm.<br />
<code>$ keytool -genkey -keyalg rsa -alias keyname<br />
Enter keystore password: password<br />
What is your first and last name?<br />
[Unknown]:<br />
What is the name of your organizational unit?<br />
[Unknown]:<br />
What is the name of your organization?<br />
[Unknown]:<br />
What is the name of your City or Locality?<br />
[Unknown]:<br />
What is the name of your State or Province?<br />
[Unknown]:<br />
What is the two-letter country code for this unit?<br />
[Unknown]:<br />
Is CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct?<br />
[no]:</code></p>
<p>Enter key password for &lt;keyname&gt;<br />
(RETURN if same as keystore password):</li>
<li>Generate the self-signed certificate containing the public key, valid for one year.<br />
<code>$ keytool -selfcert -alias keyname -validity 365<br />
Enter keystore password: password</code></li>
<li>Use jarsigner to sign the JAR file, using the RSA credentials in your keystore that were generated in the previous steps. Make sure the same alias name is specified.<br />
<code>$ jarsigner MyApplet.jar keyname<br />
Enter Passphrase for keystore: password</code></li>
<li>Verify the JAR file.<br />
<code>$ jarsigner -verify -verbose -certs MyApplet.jar</code></p>
<p>s = signature was verified<br />
m = entry is listed in manifest<br />
k = at least one certificate was found in keystore<br />
i = at least one certificate was found in identity scope</p>
<p>jar verified.</li>
<li>Your applet has been signed properly. You are now ready to deploy your RSA signed applet.</li>
</ol>
</div>
</div>


<p>Related posts:<ol><li><a href='https://www.vincentkong.com/2008/12/ssh-with-a-web-browser' rel='bookmark' title='Permanent Link: SSH with a Web Browser'>SSH with a Web Browser</a></li>
<li><a href='https://www.vincentkong.com/2007/06/java-code-snippet-for-sending-email-using-gmail-smtp-server' rel='bookmark' title='Permanent Link: Java Code Snippet for Sending Email using Gmail SMTP Server'>Java Code Snippet for Sending Email using Gmail SMTP Server</a></li>
<li><a href='https://www.vincentkong.com/2007/06/configuring-apache-for-ssl-support' rel='bookmark' title='Permanent Link: Configuring Apache for SSL Support'>Configuring Apache for SSL Support</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>https://www.vincentkong.com/2008/02/signing-java-applets-using-rsa-certificate/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting Up Log4j Quickstart Guide</title>
		<link>https://www.vincentkong.com/2007/06/setting-up-log4j-quickstart-guide</link>
		<comments>https://www.vincentkong.com/2007/06/setting-up-log4j-quickstart-guide#comments</comments>
		<pubDate>Wed, 13 Jun 2007 15:57:09 +0000</pubDate>
		<dc:creator>Vincent Kong</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://wordpress.vincentkong.com/?p=94</guid>
		<description><![CDATA[Log4j is an open source tool developed for putting log statements into your Java application. It&#8217;s allows log statements to remain in shipped code while giving the user the ability to enable logging at runtime without modifying any of the application binary. The easiest way to setup Log4j is to create a log4j.properties file and [...]


Related posts:<ol><li><a href='https://www.vincentkong.com/2007/10/tomcat-55-doesnt-start-in-ubuntu-710' rel='bookmark' title='Permanent Link: Tomcat 5.5 Doesn&#8217;t Start in Ubuntu 7.10'>Tomcat 5.5 Doesn&#8217;t Start in Ubuntu 7.10</a></li>
<li><a href='https://www.vincentkong.com/2007/05/apache-for-ubuntu-quickstart-guide' rel='bookmark' title='Permanent Link: Apache for Ubuntu Quickstart Guide'>Apache for Ubuntu Quickstart Guide</a></li>
<li><a href='https://www.vincentkong.com/2007/06/awstats-quickstart-guide' rel='bookmark' title='Permanent Link: AWStats Quickstart Guide'>AWStats Quickstart Guide</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Log4j is an open source tool developed for putting log statements into your Java application. It&#8217;s allows log statements to remain in shipped code while giving the user the ability to enable logging at runtime without modifying any of the application binary.</p>
<p>The easiest way to setup Log4j is to create a <code>log4j.properties</code> file and put in root of your classes directory. A typical example of the <code>log4j.properties</code> file is as follows:</p>
<pre><strong># Set root logger level to INFO and log to console, and log file appender.</strong>
log4j.rootLogger=INFO, Console, LogFile
<strong># Set the logger level to DEBUG for all classes under the package com.mycompany.</strong>
log4j.logger.com.mycompany=DEBUG
<strong># Define the settings for the console appender.</strong>
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %C - %m%n
<strong># Define the settings for the log file appender.
# Log file rotates every month.
</strong>log4j.appender.LogFile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.LogFile.DatePattern='.'yyyy-MM
<strong># Location to where the log file exists.</strong>
log4j.appender.LogFile.file=/path/to/logfile.log
log4j.appender.LogFile.layout=org.apache.log4j.PatternLayout
log4j.appender.LogFile.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %C - %m%n</pre>
<p>The <code>ConversionPattern</code> determines what the format of each line logged:</p>
<ul>
<li><code>%d{ISO8601}</code> Output the date in ISO8601 format.</li>
<li><code>%t</code> Output the thread that generated the logging event.</li>
<li><code>%-5p</code> Output the priority of the logging event left<br />
justified to a width of five characters.</li>
<li><code>%C</code> Output the fully qualified class name of the caller<br />
issuing the logging request.</li>
<li><code>%m</code> Output the application supplied message associated with<br />
the logging event.</li>
<li><code>%n</code> Output the platform dependent line separator character or<br />
characters. e.g &#8220;\n&#8221; or &#8220;\n\r&#8221;</li>
</ul>
<p>For more information refer to the <a href="http://logging.apache.org/log4j/docs/documentation.html">Log4j documentation</a></p>


<p>Related posts:<ol><li><a href='https://www.vincentkong.com/2007/10/tomcat-55-doesnt-start-in-ubuntu-710' rel='bookmark' title='Permanent Link: Tomcat 5.5 Doesn&#8217;t Start in Ubuntu 7.10'>Tomcat 5.5 Doesn&#8217;t Start in Ubuntu 7.10</a></li>
<li><a href='https://www.vincentkong.com/2007/05/apache-for-ubuntu-quickstart-guide' rel='bookmark' title='Permanent Link: Apache for Ubuntu Quickstart Guide'>Apache for Ubuntu Quickstart Guide</a></li>
<li><a href='https://www.vincentkong.com/2007/06/awstats-quickstart-guide' rel='bookmark' title='Permanent Link: AWStats Quickstart Guide'>AWStats Quickstart Guide</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>https://www.vincentkong.com/2007/06/setting-up-log4j-quickstart-guide/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Default JVM in Ubuntu</title>
		<link>https://www.vincentkong.com/2007/06/setting-default-jvm-in-ubuntu</link>
		<comments>https://www.vincentkong.com/2007/06/setting-default-jvm-in-ubuntu#comments</comments>
		<pubDate>Mon, 11 Jun 2007 15:56:03 +0000</pubDate>
		<dc:creator>Vincent Kong</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://wordpress.vincentkong.com/?p=93</guid>
		<description><![CDATA[There are circumstances where you may need to have more than one version of Java installed, but how do you switch between them? Execute the following command to list the installed JVMs: $ sudo update-alternatives --config java Simply enter the number for the JVM to use. The * shows the current selected JVM. Related posts:Managing [...]


Related posts:<ol><li><a href='https://www.vincentkong.com/2007/05/managing-packages-in-ubuntu' rel='bookmark' title='Permanent Link: Managing Packages in Ubuntu'>Managing Packages in Ubuntu</a></li>
<li><a href='https://www.vincentkong.com/2007/05/setting-up-ddclient-on-ubuntu' rel='bookmark' title='Permanent Link: Setting up ddclient on Ubuntu'>Setting up ddclient on Ubuntu</a></li>
<li><a href='https://www.vincentkong.com/2008/01/running-windows-application-on-ubuntu' rel='bookmark' title='Permanent Link: Running Windows Application on Ubuntu'>Running Windows Application on Ubuntu</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>There are circumstances where you may need to have more than one version of Java installed, but how do you switch between them?</p>
<p>Execute the following command to list the installed JVMs:</p>
<p><code>$ sudo update-alternatives --config java </code></p>
<p>Simply enter the number for the JVM to use. The * shows the current selected JVM.</p>


<p>Related posts:<ol><li><a href='https://www.vincentkong.com/2007/05/managing-packages-in-ubuntu' rel='bookmark' title='Permanent Link: Managing Packages in Ubuntu'>Managing Packages in Ubuntu</a></li>
<li><a href='https://www.vincentkong.com/2007/05/setting-up-ddclient-on-ubuntu' rel='bookmark' title='Permanent Link: Setting up ddclient on Ubuntu'>Setting up ddclient on Ubuntu</a></li>
<li><a href='https://www.vincentkong.com/2008/01/running-windows-application-on-ubuntu' rel='bookmark' title='Permanent Link: Running Windows Application on Ubuntu'>Running Windows Application on Ubuntu</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>https://www.vincentkong.com/2007/06/setting-default-jvm-in-ubuntu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Code Snippet for Sending Email using Gmail SMTP Server</title>
		<link>https://www.vincentkong.com/2007/06/java-code-snippet-for-sending-email-using-gmail-smtp-server</link>
		<comments>https://www.vincentkong.com/2007/06/java-code-snippet-for-sending-email-using-gmail-smtp-server#comments</comments>
		<pubDate>Thu, 07 Jun 2007 15:53:35 +0000</pubDate>
		<dc:creator>Vincent Kong</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://wordpress.vincentkong.com/?p=92</guid>
		<description><![CDATA[The partial code below shows how to sent an email using the Gmail&#8217;s SMTP server: Properties properites = new Properties(); properties.put("mail.smtp.host", "smtp.gmail.com"); properties.put("mail.smtp.port", "25"); properties.put("mail.smtp.auth", "true"); properties.put("mail.smtp.starttls.enable", "true"); properties.put("mail.smtp.socketFactory.port", "465"); properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); properties.put("mail.smtp.socketFactory.fallback", "false"); Session session = Session.getInstance(properties, new Authenticator() { public PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("username@gmail.com", "password"); } }); Message msg = new [...]


Related posts:<ol><li><a href='https://www.vincentkong.com/2008/12/sending-email-with-ant' rel='bookmark' title='Permanent Link: Sending Email with Ant'>Sending Email with Ant</a></li>
<li><a href='https://www.vincentkong.com/2007/06/java-code-snippet-for-parsing-strings-into-date' rel='bookmark' title='Permanent Link: Java Code Snippet for Parsing Strings into Date'>Java Code Snippet for Parsing Strings into Date</a></li>
<li><a href='https://www.vincentkong.com/2008/02/signing-java-applets-using-rsa-certificate' rel='bookmark' title='Permanent Link: Signing Java Applets Using RSA Certificate'>Signing Java Applets Using RSA Certificate</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The partial code below shows how to sent an email using the Gmail&#8217;s SMTP server:</p>
<pre>Properties properites = new Properties();</pre>
<pre>properties.put("mail.smtp.host", "smtp.gmail.com");
properties.put("mail.smtp.port", "25");
properties.put("mail.smtp.auth", "true");
properties.put("mail.smtp.starttls.enable", "true");
properties.put("mail.smtp.socketFactory.port", "465");
properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
properties.put("mail.smtp.socketFactory.fallback", "false");

Session session = Session.getInstance(properties, new Authenticator() {
      public PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication("username@gmail.com", "password");
      }
});

Message msg = new MimeMessage(session);
msg.setFrom(...);
msg.addRecipient(...);
msg.setSubject(...);
msg.setText(...);

Transport.sent(msg);</pre>


<p>Related posts:<ol><li><a href='https://www.vincentkong.com/2008/12/sending-email-with-ant' rel='bookmark' title='Permanent Link: Sending Email with Ant'>Sending Email with Ant</a></li>
<li><a href='https://www.vincentkong.com/2007/06/java-code-snippet-for-parsing-strings-into-date' rel='bookmark' title='Permanent Link: Java Code Snippet for Parsing Strings into Date'>Java Code Snippet for Parsing Strings into Date</a></li>
<li><a href='https://www.vincentkong.com/2008/02/signing-java-applets-using-rsa-certificate' rel='bookmark' title='Permanent Link: Signing Java Applets Using RSA Certificate'>Signing Java Applets Using RSA Certificate</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>https://www.vincentkong.com/2007/06/java-code-snippet-for-sending-email-using-gmail-smtp-server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Code Snippet for Parsing Strings into Date</title>
		<link>https://www.vincentkong.com/2007/06/java-code-snippet-for-parsing-strings-into-date</link>
		<comments>https://www.vincentkong.com/2007/06/java-code-snippet-for-parsing-strings-into-date#comments</comments>
		<pubDate>Thu, 07 Jun 2007 15:50:52 +0000</pubDate>
		<dc:creator>Vincent Kong</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://wordpress.vincentkong.com/?p=91</guid>
		<description><![CDATA[SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd"); String input = "2007-05-04"; Date d; try { d = formatter.parse(input); } catch (ParseException e) { e.printStackTrace(); } Related posts:Java Code Snippet for Sending Email using Gmail SMTP Server Signing Java Applets Using RSA Certificate Installing TinyMCE Editor in Drupal


Related posts:<ol><li><a href='https://www.vincentkong.com/2007/06/java-code-snippet-for-sending-email-using-gmail-smtp-server' rel='bookmark' title='Permanent Link: Java Code Snippet for Sending Email using Gmail SMTP Server'>Java Code Snippet for Sending Email using Gmail SMTP Server</a></li>
<li><a href='https://www.vincentkong.com/2008/02/signing-java-applets-using-rsa-certificate' rel='bookmark' title='Permanent Link: Signing Java Applets Using RSA Certificate'>Signing Java Applets Using RSA Certificate</a></li>
<li><a href='https://www.vincentkong.com/2007/05/installing-tinymce-editor-in-drupal' rel='bookmark' title='Permanent Link: Installing TinyMCE Editor in Drupal'>Installing TinyMCE Editor in Drupal</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<pre>SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd");
String input = "2007-05-04";
Date d;
try {
    d = formatter.parse(input);
}
catch (ParseException e) {
   e.printStackTrace();
}</pre>


<p>Related posts:<ol><li><a href='https://www.vincentkong.com/2007/06/java-code-snippet-for-sending-email-using-gmail-smtp-server' rel='bookmark' title='Permanent Link: Java Code Snippet for Sending Email using Gmail SMTP Server'>Java Code Snippet for Sending Email using Gmail SMTP Server</a></li>
<li><a href='https://www.vincentkong.com/2008/02/signing-java-applets-using-rsa-certificate' rel='bookmark' title='Permanent Link: Signing Java Applets Using RSA Certificate'>Signing Java Applets Using RSA Certificate</a></li>
<li><a href='https://www.vincentkong.com/2007/05/installing-tinymce-editor-in-drupal' rel='bookmark' title='Permanent Link: Installing TinyMCE Editor in Drupal'>Installing TinyMCE Editor in Drupal</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>https://www.vincentkong.com/2007/06/java-code-snippet-for-parsing-strings-into-date/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
