<?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>logIt &#187; java</title>
	<atom:link href="https://lakm.us/logit/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>https://lakm.us/logit</link>
	<description>Log Around The Clock</description>
	<lastBuildDate>Sat, 06 Jun 2015 14:17:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Hello World with JamVM Embedded JVM on Ubuntu ARM</title>
		<link>https://lakm.us/logit/2011/12/hello-world-with-jamvm-embedded-jvm-on-ubuntu-arm/</link>
		<comments>https://lakm.us/logit/2011/12/hello-world-with-jamvm-embedded-jvm-on-ubuntu-arm/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 09:53:19 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ARMv7]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JVM]]></category>
		<category><![CDATA[QEMU]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=380</guid>
		<description><![CDATA[While waiting for my BeagleBoard xM shipment, I was considering Java as one of the possible application platforms. Anyhow, the keyword &#8220;embedded Java ARM&#8221; landed me to the tiny JamVm. This JVM is said to be working with ARM Cortex A8 which can be emulated under QEMU running Ubuntu ARM. The fact that there had [...]]]></description>
				<content:encoded><![CDATA[<p>While waiting for my <a href="http://beagleboard.org/hardware-xM" title="http://beagleboard.org/hardware-xM" target="_blank">BeagleBoard xM</a> shipment, I was considering Java as one of the possible application platforms. Anyhow, the keyword &#8220;embedded Java ARM&#8221; landed me to the tiny <a href="http://jamvm.sourceforge.net/" title="http://jamvm.sourceforge.net/" target="_blank">JamVm</a>. This JVM is said to be working with <a href="http://en.wikipedia.org/wiki/ARM_Cortex-A8" title="http://en.wikipedia.org/wiki/ARM_Cortex-A8" target="_blank">ARM Cortex A8</a> which can be emulated under <a href="./2011/11/ubuntu-on-qemu-processor-emulator/" title="Ubuntu on QEMU Processor Emulator" target="_blank">QEMU running Ubuntu ARM</a>. The fact that there had been already a Karmic image that work with QEMU would shorten the time.</p>
<p>A &#8220;Hello World&#8221; class to test the JVM will be:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> HelloWorldJamVM <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;hello world&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>saved as <code>HelloWorldJamVM.java</code>. However, executing a &#8220;Hello World&#8221; requires longer steps than writing that class.</p>
<p>In order for the JamVM 1.5.4 to run on Ubuntu, we need (1) <code>build-essential</code> (certainly so) and (2) <a href="http://gcc.gnu.org/java/ " title="The GNU Compiler for Java" target="_blank">GCJ</a> with dependency of (3) <code>zlib1g-dev</code>. It&#8217;s all available in the Karmic ARM repo. Another thing that we need is <a href="http://www.gnu.org/software/classpath/classpath.html" title="GNU Classpath" target="_blank">GNU Classpath 0.98</a>.</p>
<p>Following the instruction, as <code>root</code> we can then <code>configure, make, make install, make install-strip</code> sources under <code>jamvm-1.5.4</code> directory. Continue them with the <code>classpath-0.98</code> sources by configuring as follow</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--disable-gtk-peer</span> <span style="color: #660033;">--disable-gconf-peer</span> <span style="color: #660033;">--disable-plugin</span> <span style="color: #660033;">--disable-Werror</span></pre></div></div>

<p>and then <code>make install</code> as usual. The whole compiling will run slow for sure as QEMU emulates ARM far from nearing native processor performance in my case.</p>
<p>We can compile the above &#8220;Hello World&#8221; using GCJ with the command <code>javac</code>, which is actually linked to <code>/usr/bin/gcj-wrapper-4.4</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">javac HelloWorldJamVM.java</pre></div></div>

<p>A <code>HelloWorldJamVM.class</code> bytecode file will appear and we can run this with JamVM</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>jamvm<span style="color: #000000; font-weight: bold;">/</span>bin 
<span style="color: #7a0874; font-weight: bold;">export</span> PATH
jamvm HelloWorldJamVM</pre></div></div>

<div class="wp-caption alignleft" style="width: 510px"><img alt="qemu-ubuntu-arm-cortex-a8-running-jamvm-embedded-jvm.jpg" src="../../../../images/qemu-ubuntu-arm-cortex-a8-running-jamvm-embedded-jvm.jpg" title="QEMU with Ubuntu ARM Cortex A8 running JamVM embedded JVM" width="450" height="261" /><p class="wp-caption-text">QEMU with Ubuntu ARM Cortex A8 running JamVM embedded JVM</p></div>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2011/12/hello-world-with-jamvm-embedded-jvm-on-ubuntu-arm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java GUI First Look</title>
		<link>https://lakm.us/logit/2009/02/java-gui-first-look/</link>
		<comments>https://lakm.us/logit/2009/02/java-gui-first-look/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 04:20:47 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[OpenView]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[java GUI]]></category>
		<category><![CDATA[motif GUI]]></category>

		<guid isPermaLink="false">http://localhost/it/?p=28</guid>
		<description><![CDATA[Unlike motif GUI session, Java GUI user session can be used in multiple logins. However, administration tools are in limited set compared to motif GUI. Get this GUI from the management server through browser port 3443 (i.e http://192.168.80.3:3443/). For Linux, Java Runtime Environment must be set. I use Sun Java 6, so: JAVA_DIR=/usr/ for the [...]]]></description>
				<content:encoded><![CDATA[<p>Unlike motif GUI session, Java GUI user session can be used in multiple logins. However, administration tools are in limited set compared to motif GUI.</p>
<p>Get this GUI from the management server through browser port 3443 (i.e <code>http://192.168.80.3:3443/</code>). For Linux, Java Runtime Environment must be set.</p>
<p>I use Sun Java 6, so: <code>JAVA_DIR=/usr/</code> for the GUI to run it as <code>$JAVA_DIR/bin/java</code>. I use <code>export JAVA_DIR=/usr/</code>  as <code>set</code> didn&#8217;t work. Fire ./ito_op and it will load (take long). I keep these .jar files &#038; everything under /opt/OV/www/htdocs/ito_op/.</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2009/02/java-gui-first-look/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
