Held Monday, August 30, 1999
Overview
In today's class, we'll revisit the basics of Java and consider some
key issues in using Unix.
Notes
- We had some confusion during Friday's lab. We'll strive to do
most of
lab J1 today
(skipping the applet section).
- The book for the class (Java Plus Data Structures) was written
for an audience in which students had the first course in Java. You
obviously don't, so don't worry when you don't understand all the Java.
- Remember: 1/10 a point of extra credit for each error you find in
Experiments in Java or Java Plus Data Structures
(and that someone else hasn't found).
- We'll discuss potential projects on Wednesday.
- Read lab O1 for Wednesday.
- I've added some responses
to the introductory survey.
- Some of you still haven't filled it out. (I hope that you haven't
all dropped the class :-)
Contents
Handouts
Summary
- There is some sense within the department that you will learn many
things about Unix ``by osmosis'' as it were.
- If I ask you to do something, and you don't know how to do that
thing, please let me know.
- You can do a number of things from the File Manager, which
you can typically start by clicking on the file drawer at the left
of the control pane.
- You can rename a file by clicking on the file and then typing the
new name.
- You can copy a file by clicking on the file and then selecting
``Copy To'' from the ``Selected'' menu.
- You can move a file into a folder by dragging the file to the folder.
- You can create a new folder using the ``File'' menu.
- You can set permissions for a file by clicking on the file and
then selecting ``Change Permissions'' from the ``Selected''
menu.
- Most Unix users prefer to write commands in the ``shell'', which
is available through the
dtterm window.
- You can rename a file by typing
- You can copy a file by typing
- You can move a file into a folder by typing
- You can create a new folder with
- (You'll find it easier to set permissions with the File Manager.)
- When you're working within the shell, you will always have a
``present working directory'' (directory is another name for
folder).
- The commands you type typically relate to the files in that folder.
- You can determine your present working directory with
- You can set your present working directory to a subfolder with
- You can set your present working directory to the enclosing folder
with
- As time progresses, you may create your own programs for the Unix
system. You typically run a program by typing the name of the
program.
- How does Unix know where to look for programs? It checks a number
of prespecified folders (including, in some cases, your current
working folder).
- What if the program you want to run is not in one of those folders?
Then you have to type the full ``path'' to the program (the list
of enclosing folders).
- When you type
/home/rebelsky/bin/jc you are running
the program called jc that resides in a folder called
bin that resides within my folder.
- At many times, you will need to copy files from Netscape Navigator.
- You can click and hold with the right mouse button on a link, and then
select ``Save Link As ...'' from the menu that appears.
- You can load the document and then use ``Save As ...'' from the
``File'' menu.
- As you may know, computers work with a number of different
``languages''.
- Each computer really understands only one language: its underlying
machine language.
- We make computers understand another language by either
- writing programs that translate the other language to
the computer's machine language (compilation)
- writing programs that read programs written in the other
language and then directly executing those programs
(interpretation)
- Java uses an interesting combination of compilation and
interpretation.
- You must first compile your Java program to Java Virtual Machine
(JVM) code.
- You then interpret the JVM code.
- To compile Java programs, write
% /home/rebelsky/bin/jc file.java
- That is, run the program called
jc (Java compiler)
that is in my bin directory.
- To interpret compiled Java programs, write
% /home/rebelsky/bin/ji file.class
- That is, run the program called
ji (Java interpreter)
that is in my bin directory.