Monday, November 11, 2013

Programming Hello World with Java on Raspberry Pi

To start program on Raspberry Pi using Java programming, what you need are JDK for Raspberry Pi and a simple text editor such as the build-in LeafPad.

Edit the code with LeafPad, with name of helloPi.java:
class helloPi
{
 public static void main(String srgs[])
 {
  
  System.out.println("Hello Raspberry Pi");
 }
}


Then compile an run it with the command:
$ javac helloPi.java
$ java helloPi

No comments: