Kickstart Intro to Java

Download Report

Transcript Kickstart Intro to Java

Setting Up Environment for Your
CS Account
COMP346/5461 - Operating Systems
Tutorial 1: Part 1.5
Revision 1.2
Date: September 9, 2003
September 16, 2002
Serguei A. Mokhov,
[email protected]
1
Why Java 1.2.1? (1)
• For the purpose of learning various concurrency problems
for the time being we’re stuck with the above mentioned
JDK version on Solaris 8. JVM of that version uses socalled “green” threads by default, and manages them itself
using the Round Robin with priority scheduling policy
(there are many policies out there, you’ll get to know what
most of them are later on in the course), so the behaviour
of the threads can be considered deterministic.
• NOTE: There is no Java 1.2.1 for Linux! Thus, if you
intend to use Linux, use 1.2.2 with green threads.
September 16, 2002
Serguei A. Mokhov,
[email protected]
2
Why Java 1.2.1? (2)
• With later versions, especially 1.3.* and above, the
JVM basically lets the OS schedule the threads,
and whatever policy the OS employs and on how
many CPU’s an application is run, makes it
completely unpredictable.
• NOTE: JVM of (virtually) any version, including
1.2.1 and 1.2.2 does not work well for us on
Windows 9x/Me platforms! Work either remotely
or install Cygwin (an UNIX emulation layer for
Windows) and work under it.
September 16, 2002
Serguei A. Mokhov,
[email protected]
3
Setting Up the Environment
• You will have to use your CS account to do
programming assignments (well, if you’re are
reluctant to come to the lab, you can do your thing
at home or any other place, but just either
download and install JDK 1.2.1, or if you have a
high speed Internet somewhere, you can always
ssh into alpha and do the thing remotely (look up
PuTTY in Google if you plan to do it in
Windows)).
September 16, 2002
Serguei A. Mokhov,
[email protected]
4
Setting Up the Environment (2)
• If you use your CS account in labs...
– Log in...
• If you logged in Linux, ssh to alpha first (you always have to
do it before compiling and running java code for this course;
otherwise, you’ll end up using whatever Java they have in
those Linux boxes) by typing in the following:
ssh -X alpha
• On Windows use either Tera Term (which is on your desktop
under icon “telnet”) with the option “ssh” and the host alpha
or through PuTTY (same thing, but more convenient).
– Most likely it’s not configured to use Java 1.2.1, you’ll
have to do some work to make happen.
– How? Please go to the next slide ---->
September 16, 2002
Serguei A. Mokhov,
[email protected]
5
Setting Up the Environment (3)
• So... edit your .cshrc file in your home directory (don’t worry,
this is only a one-time procedure).
– Use your favorite text editor and type:
yourtexteditorhere ~/.cshrc
(What? Don’t have a favorite text editor yet? :-) Here are some suggestions
to pick from: xemacs, emacs, vim, pico, ...)
– Among the lines there should be something like this:
set path=( /usr/ucb /usr/bin /usr/sbin /bin ...)
So, add at the beginning /pkg/java-1.2.1/bin :
set path=( /pkg/java-1.2.1/bin /usr/ucb /usr/bin /usr/sbin /bin ...)
DO NOT REMOVE ANYTHING FROM THIS LINE UNLESS YOU
KNOW WHAT YOU ARE DOING.
– After saving the above, type in the following, so your changes take effect:
source ~/.cshrc
rehash
September 16, 2002
Serguei A. Mokhov,
[email protected]
6
Setting Up the Environment (4)
• Check the Java version:
java -version
If you see smth like this you should be all set:
java version "1.2.1”
Classic VM (build JDK-1.2.1-A, green threads, sunwjit)
• Come to labs to actually set this thing up and ask
your lab instructor if you require some assistance.
September 16, 2002
Serguei A. Mokhov,
[email protected]
7
References
1.
2.
3.
www.cygwin.com
www.chiark.greenend.org.uk/~sgtatham/putty/download.html
man ssh
September 16, 2002
Serguei A. Mokhov,
[email protected]
8