If you need help getting tio working on your Windows95/98 machine
look here.
Compiling and running Java programs
In the lab we
will be using the standard/free JDK from Sun Microsystems running under
Windows/NT. You will use
any editor and then run javac to compile your program and java to execute it
as described below. You can also run Java on
angus (a NetBSD) machine, or
manray (a Solaris machine). I don't know what the load will be on either of
those machines. On angus your usual unix file structure is available.
- When you first sit down at the workstation you need to run
a batch file that will set up some environment variables for you. To do that
run the batch file:
PC Files on F:\Programming\Sun Java Development\Start jdk.bat
You can run this by either double clicking the "F:" icon on
the desktop and then double clicking the other folders in the path, or you can
use the file system browser program "Exploring NT" which you will find under
the Start button on the control bar at the bottom left corner of the screen.
- The "Start jdk.bat" file will display a file with some information that
you will want to read the first time. In the future you can just close this
window immediately by clicking the X in the upper right corner of the window.
- Now you must start a command line shell which you do by clicking the
Start icon in the lower left corner and then clicking Programs and then
clicking "Command Prompt".
- To create your Java program, you can use any editor. A reasonable choice
is SuperEdit which you will find under the Start/Programs just as you did for
the Command Prompt.
- After typing in your file, save it, either to a floppy or to c:\usertemp.
- In the "Command Prompt" window, first cd to the directory containing
your Java source file, e.g. MyClass.java. You compile a java program with
"javac MyClass.java".
- In the "Command Prompt" window, you run a compiled Java program with
"java MyClass" (no extension) where MyClass is the name of a class that
contains a method main().
- When you are done, be sure and save your work either on a floppy or
use ftp to transfer the Java source files to your Unix account, as described
below.
FTP and Submit
You will need to ftp your files to your unix account in order to submit
your completed programs. In addition, you may wish to use ftp and unix to
save your work instead of using a floppy.
The Windows FTP utility can be found under the Start popup menu (lower left
corner), then Internet Tools, then Unix File Transfer. This program is
very easy to use. Fill in the UserID (your unix login name) and Password fields.
Once connected, you can select a file on the left window (Windows), select a
directory in the right window, then click the right pointing arrow in the
middle to transfer the file. You can move files or folders in either direction.
Once you have copied your files to your unix account, login to your unix
account (Start/Internet Tools/Telnet), and run
submit.
The command you will type in for your first assignment will be:
submit cmps060n hw1 myFileName.java
To see more info on unix and working with CSE machines, see the other lab pages
[Homepage] |
[General Lab Info] |
[TA's & Tutors] |
[FAQ's] |
[Supplements] |
[Homework] |
[Excellent Programs] |
[Exams]
Modified by Doug Whitmore on Jan 10, 1998.