How to use the Java System
-
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
- Redirect the output to your local computer. This is done by the following
command:
setenv DISPLAY <Rechnername>.cip2b.tu-harburg.de:0
- Change to the directory that belongs to your working group:
cd ooad<xx>
- Start working with Java
Important Steps in Writing and Running Your First Java Program
- Create some source code within your text editor like the class Cell
xemacs &
- Save it as .java - file, use the name of the class plus the extension .java (e.g.
Cell.java)
- Compile the source file: javac
javac Cell.java
- You get bytecode within a .class - file (Cell.class)
- Run your application by interpreting the primary class' bytecode
java Cell
- 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