How to install the Keyboard class\\ under Unix and Linux in the DTU databar

How to install the Keyboard class
under Unix and Linux in the DTU databar

In the course you will need the Keyboard class of the Java textbook for reading values, e.g. numbers, from the keyboard.

  1. Enter your home directory: cd  
  2. Create a directory named java: mkdir java
  3. Enter the directory just created: cd java
  4. Create a directory named cs1: mkdir cs1
  5. Download (either from the CD of the Java textbook or from the exercise home page) the file Keyboard.java into the cs1 directory
  6. Compile the Keyboard.java file: javac Keyboard.java
  7. Enter your home directory: cd  
  8. Adjust the $CLASSPATH variable enabling the java compiler to search for packages stored in your java directory or in the actual directory:

    1. First, find out which kind of shell is used: echo $SHELL
      (In case you want to change to a bash shell or a tcsh shell, you can do so using the commands bash and tcsh, respectively.)
    2. If a bash shell is in use act like this:

      1. Append at the bottom of your .bashrc file the following two lines:
          #java classpath
          export CLASSPATH=~/java:.
        
        
        (In case an export instruction of the form export CLASSPATH=p already exists, change it to export CLASSPATH=p:~/java:. )
      2. From a command prompt execute the command: source .bashrc
    3. If a tcsh shell is in use act like this:

      1. Append at the bottom of your .tcshrc file the following two lines:
          #java classpath
          setenv CLASSPATH ~/java:.
        
        

        (In case a setenv instruction of the form setenv CLASSPATH p already exists, change it to setenv CLASSPATH p:~/java:. )

      2. From a command prompt execute the command: source .tcshrc



Maintained by: Anne Haxthausen, IMM, DTU
Last modified: Sep 6, 2002



File translated from TEX by TTH, version 3.01.
On 6 Sep 2002, 10:58.