CEWES Java Workshop, May 19, 1998
Compiling Java


Follow any directions necessary to set up the Java compiler path or environments on your machine, if necessary.

Compiling and Viewing Applets

  1. Copy these two files to your local disk

    HelloAgainApplet.java and HelloAgainApplet0.html

    Applets may also be viewed in the browser by viewing the local file.

  2. Compile the java file by typing the command
    javac HelloAgainApplet.java 
    resulting in the file HelloAgainApplet.class.

  3. View the local file HelloAgainApplet0.html in the appletviewer by typing the command
    appletviewer HelloAgainApplet0.html 

Compiling and Running Applications

  1. Copy this file to your local disk

    RollDice.java

  2. Compile the java file by typing the command
    javac RollDice.java 
    resulting in the file RollDice.class.

  3. Run the .class file by typing the command
    java RollDice

Other Java examples are found on the NPAC Java Resources Page.


Nancy McCracken at the Northeast Parallel Architectures Center.