Sun Sep 24 23:02:27 CEST 2006

java.png Java: Hello World

Today I tried to compile my first Hello World program in Java with the help of the GCJ (GNU Compiler for Java).

At first I've looked at the Hello World java page of the Wikipedia and then wrote the file:

sebastian@nanofortnight ~ $ cat HelloNewWorld.java
public class HelloNewWorld {
    public static void main(String[] args) {
        System.out.println("Hello New World!");
    }
}

After this I began with the compilation:

sebastian@nanofortnight ~ $ gcj -c -g -O HelloNewWorld.java; \
     gcj --main=HelloNewWorld -o HelloNewWorld HelloNewWorld.o
sebastian@nanofortnight ~ $ ./HelloNewWorld
Hello New World!

It is unimaginable how long it took to start the simple program...


Posted by Sebastian Wieseler | Categories: projects/programming |