Basic HTML version of Foils prepared 20 Sept 97

Foil 8 Java Applications in a Nutshell

From Java Tutorial - Summer 1997 Part 1:Introduction to Java Language CEWES Tutorial, Classes SU/Jackson State -- July 22-25 and Fall 97. by Nancy J. McCracken,Geoffrey C. Fox


1 All Java programs are written into a file with a ".java" extension.
2 Applications are .java files with a main method which is excuted first.
3 How to compile and run a Java application:
  • Run the compiler on a .java file:
    • javac MyProgram.java
    • producing a file "MyProgram.class" of Java bytecodes
  • Run the interpreter on a .class file:
    • java MyProgram
    • which executes the bytecodes
4 The resources javac and java are part of JDK and are not in Netscape and so are not necessarily available on the same machine as your web server.

in Table To:


© on Sun Oct 12 1997