Can I Compile Java Programs?

Yes - jikes is included for this purpose (don't forget to check your JIKESPATH environment variable setting).

Figure 9.1. Test Java Program HelloNst.java

public class HelloNst {

  public static void main(String[] args) {
    System.out.println("Hello NST");
  }

}

Figure 9.2. Compiling/Running HelloNst.java

[root@probe root]# echo $JIKESPATH
:/usr/java/jre1.5.0/lib/rt.jar
[root@probe root]# jikes HelloNst.java
[root@probe root]# java HelloNst
Hello NST
[root@probe root]# 

Note

The NST could be quite handy as a educational tool. Imagine someone wanting to teach Java to a group of students. For the price of a CDR and a memory stick (or space on a server), you have a instant development system that you can always get back to a known state simply by pressing the power button.