Java 1.6.0_03 on Ovid and Vergil
What is Java? Java is an object-oriented programming language
developed by Sun.
Using the Software
To compile and run a java program on Ovid or Vergil, at the system prompt
type:
- % javac file.java
- % java file
where file is the name of a java program with the file
extension .java. Here is a tiny example:
- The program is named "echo.java":
// This program echoes the arguments that you type in. To test it
// you do this:
// javac echo.java
// java echo a b c d e f
//
public class echo{
public static void main(String argv[]) {
for (int i = 0; i < argv.length; i++)
System.out.print(argv[i] + " ");
System.out.print("\n");
System.exit(0);
}
}
- which you compile and run as Ovid or Vergil as follows:
- % javac echo.java
% java echo a b c d e f
Documentation
Sun provides tutorials for
Learning the Java Language.
Technical Support
Help is available from UW Technology.
Send a question to
help@u.washington.edu if you need help with this software.
(software updated 12/29/2007)
|