How to use the Java System

  1. Log in to the system sun01 as user ooad. This can be done with the following command:

    rlogin -l ooad sun01.sts.tu-harburg.de
  2. Redirect the output to your local computer. This is done by the following command:
    setenv DISPLAY <Rechnername>.cip2b.tu-harburg.de:0
  3. Change to the directory that belongs to your working group:
    cd ooad<xx>
  4. Start working with Java

Important Steps in Writing and Running Your First Java Program

  1. Create some source code within your text editor like the class Cell
    xemacs &
  2. Save it as .java - file, use the name of the class plus the extension .java (e.g. Cell.java)
  3. Compile the source file: javac
    javac Cell.java 
  4. You get bytecode within a .class - file (Cell.class)
  5. Run your application by interpreting the primary class' bytecode
    java Cell
  6. The Java interpreter looks for the main-method and executes it.

 

Debugging

You can debug you r program by using the debug option of the compiler:

javac -debug Cell.java