#Hello World in Java

<div class="text-success lead">
Java is a programming language originally developed by James Gosling at Sun Microsystems and released 
in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its 
syntax from C and C++ but has a simpler object model and fewer low-level facilities.
</div>

<img src="./java.jpg"/>

##Hello world example

In this example we'll illustrate how to compile a "Hello world !" source on a host PC with 
Ubuntu Linux using javac and run the bytecode result on the Acme board.

The example of code is the usually Sun example:

<pre class="prettyprint">
public class Hello {
   public static void main(String[] args) {
       System.out.println("Hello, world !");
   }
}
</pre>

Install the JDK on your Ubuntu PC using Synaptic. The package name is default-jdk and is the latest Open Source version of Java OpenJDK 6.

Compile the Hello.java file typing:

<pre class="prettyprint">
$ javac Hello.java
</pre>

Open a terminal session on board and type:

<pre class="prettyprint">
debarm:~# apt-get update
debarm:~# apt-get install default-jre
</pre>

Go back to the Ubuntu terminal session and copy the Hello.class byte code to the board:

<pre class="prettyprint">
$ scp Hello.class root@<fox_ip_address>:/root
root@<fox_ip_address>'s password: 
Hello.class                                   100%  418     0.4KB/s   00:00    
$
</pre>

Go to the board and type:

<pre class="prettyprint">
debarm:~# cd /root
debarm:~# java Hello
Hello, world !
</pre>

##Related links

<ul>
<li><a href="http://www.java.com/">Official Website</a></li>
<li><a href="http://java.sun.com/">Developer Resources for Java Technology</a></li>
<li><a href="http://wiki.debian.org/Java">Java under Debian Linux</a></li>
<li><a href="http://en.wikipedia.org/wiki/Java_(programming_language)">Wikipedia definition of Java</a></li>
</ul>

