There are two basic steps to running a Java program; you must compile the program and then interpret the compiled program. Compilation verifies the syntax of your program and translates your program into a language that the computer can more easily understand. The interpreter then executes this more easily understandable language.
To compile a program named XXX.java, type
% /home/rebelsky/bin/jc XXX.java
The "jc" stands for "Java compiler".
If there are no observable errors in your program, you will see another prompt
after about one minute. If there are observable errors in your program, the
compiler will print a list of line/error pairs. Most people find the error
messages unreadable, so feel free to ask me for help understanding them.
When compilation succeeds, the compiler creates a file called XXX.class.
To execute the compiled program, type
% /home/rebelsky/bin/ji XXX
The "ji" stands for "Java interpreter".
Note that you are running special scripts designed for my class. If you would
prefer to execute the actual Java compiler and interpreter, you'll need to make
a few changes to your .cshrc file (this is only for more advanced
students). The standard java compiler is called javac. The
standard java interpreter is called java. Both
can be found in /usr/local/java/bin
In order to use these, you will probably want to do the following.
/usr/local/java/bin to your path. The standard command
(which goes in your .cshrc) is
set path = (/usr/local/java/bin ${path})
CLASSPATH environment variable to your .cshrc.
This has the form dir:dir:...:dir.
Your class path should include the current directory my Java library.
If you use Bailey's structures package, you'll also need to include a
link to that. A sample command is
setenv CLASSPATH ".:/u2/rebelsky/lib/Java/"
The first time you make these changes, you'll need to reload your
.cshrc file with
% source ~/.cshrc
If you attempt to run Java on the machines in the two back rows of the MathLAN
classroom (Science 2435) you will get an error. Unfortunately, those machines
do not have sufficient resources to run Java. On those machines, you will need
to connect to another computer in order to run Java. We've set up a standard
list of machines to connect to. Ask me if you need help connecting to another
machine. You can also run
% /home/rebelsky/bin/alternate
to automatically connect to the appropriate machine.
Machine Connects to robinson riemann stokes euler taylor gauss venn mathieu weyl banach wronski goedel young hardy zorn fermat
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Fri Jan 16 09:33:50 1998.
This page generated on Thu Apr 2 13:50:19 1998 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu