CSE 413 Winter 2001 - Using Java

You may use whatever version of Java you wish for compiling your Java homework. However, the code you turn in must compile with Sun's JDK. The current Sun implementation (JDK 1.3, aka Java 2) is available free for a personal machine -- go to the java.sun.com web page and from there to the JDK 1.3 link.

Using Java on Windows

Java's JDK 1.3  is available in some windows labs (including MSCC).  The executables should be in C:\apps\jdk1.3\bin. On most machines the paths are already set up. Put your java source code in some directory. Get an MSDOS prompt and connect to that directory.

A sample program is HelloWorld.java or type:

public class HelloWorld
{
   public static void main(java.lang.String[] args)
   {
      java.lang.System.out.println("Hello World");
   }
}

To compile this program:

javac HelloWorld.java 

This should create a HelloWorld.class file containing the compiled Java bytecodes. You can now run these through the bytecode interpreter:

java HelloWorld
Hello World