CSCI 111 Java on UNIX


Running a Java Applet on the Web

  1. The .html file:
    Let's see how to put applets on our web pages. Once you are sure that you are in the correct folder (in public_html/csci111/lab1 to follow along with this page) you want to create a new file named Now you should be in the editor and editing the file lab1.html. Enter the following text to create a short web page, enter your name where it asks for it. You should save this file and then exit the editor.

    Now startup Firefox (i.e., a browser window) and open the following address to view your web page......substitute your login in the address. Your WinSCP (and/or Putty session) should still be open.

  2. The .java file:
    Go back to your WinSCP session and create Java program (so far you made an html page) by creating a new file with the name HelloWorld.java

    Now type in the following program into the file and save it once done (or you can use the Swing version and JApplet. even easier)

    Don't forget to SAVE and then Exit once you are done entering the program.

  3. The .class file:
    On the UNIX side,
    enter the following command to compile the program and convert it from the text we typed into a form the computer understands. You should get a file called HelloWorld.class as a result of compiling. If you get an error return to task 4 and make sure you typed in the code correctly. Repeat steps 4 and 5 until the program compiles with no errors.

  4. The <applet> tag :
    Edit your already created lab1.html file in order to enter the following line into the lab1.html file before the last    </body>    and    </html>    tags.


Unix Accounts - Your Web Page

Now that you have a UNIX account, you have your own website. We have seen how you can make links to this course (CSCI 111). You should feel free to use the homepage to show who you are and to link to other courses as well.

Feel free to ask in class or in lab how to add things to your page.


Unix Command Prompt Specifying Current Folder Location

  • go to your top level in UNIX (you can do this with the command cd...just simply type cd and hit return)
  • give the command pico .profile to edit a .profile file (or you can make a file named .profile using WinSCP)
  • type in the following line:

    PS1='$SYS:$PWD> '

  • In pico, Ctrl o (as in oh) saves, do this, then hit return to keep the name .forward
  • In pico, Ctrl x exits. When you log on from now on, it should provide the information
  • To make it work in the session you are in right now, give the command
         . .profile


    Unix Commands

    • ls    list files and directories in the current directory.
    • ls -F    lists, but distinguishes directories with slash
    • cd    change directory
    • pwd    path name of the current working directory
    • man    manual pages
    • rm    remove a file careful with this one!
    • pico    simple text editor
    • pine    simple email program
    • java    Java virtual machine is used to run Java based programs
    • javac    Java compiler
    • mkdir    create a directory
    • websetup    create a space on the ect web server to host your web pages ( not standard Unix )
    • more    view a file
    • help    list the help file which includes a short introduction to the Unixcommands
    • lynx    a text only web browser

    More Unix Commands


    w
    who is logged on to the system with process information

    rwho
    who is logged on to the local network of Unix servers

    ping
    network packet time from host to another machine

    traceroute
    the route an Internet connection takes for sending packets

    vi
    visual editor

    emacs
    another visual editor created by GNU organization

    mv
    move and rename command

    ps
    find my current processes

    kill
    shutdown processes

    checkdisk
    check quota and available disk space

    talk
    simple chat tool

    date
    today's date and time

    cal
    calendar

    ln
    link to a directory ( short cut to a path )

    mkdir
    create a new directory

    finger
     
    who
     
    uptime
     


    Helpful Web Sites

    More Web Sites
    check these out