CSC 212: Programming with Data Structures

Lab 0: Hello World

Due: Thursday, Jan. 28, 11:59pm

Credit: based on Lab 0 by Nick Howe.

The goal of this lab is to set up your Java development environment and become familiar with submitting assignments on the Unix server. If you want to use Eclipse (optional but recommended) and you have a Mac, the video below will guide you through the entirety of Lab 0. If you are not using Eclipse or you have Windows, the video will still encompass most of Lab 0, just make a few small tweaks described in the steps below.

Video Tutorial of Lab 0

(Notes: zoom out until the video matches your screen size. If you are doing this during lab section, turn off the sound.)

  1. First make sure you can access the server, using one of the methods below:

    • Lab machine: If the machine is in Windows mode, restart and boot in Linux Mint mode. Log in with your class account username and password, then open up the terminal.

    • Windows machine: Download and run either Cyberduck (this option might be easier and has been used by 212 students in the past) or Putty, using the server name
      aurora.smith.edu 
      There might be a warning/error message, but in this case you can proceed. Then, when prompted, log in with your class account username and password.

    • Mac machine: Open up the terminal and run
      ssh username@aurora.smith.edu 
      replacing "username" with your class account username, and enter your password.
  2. On the server, run the following commands to create a new directory for Lab 0:
    cd public_html
    
    mkdir lab0
    
    cd lab0
  3. Now we want to create a HelloWorld.java file in the lab0 directory. There are again a few options for doing this:

    • (Recommended) Download the right version of Eclipse for your operating system. Eclipse is not required, but it is recommended. Create the file HelloWorld.java using the steps in the video tutorial. After that, you'll need to copy this file onto the server (unless you are on a lab machine, then you are already there!) If you have a Mac/Linux machine you can run:

       scp HelloWorld.java username@aurora.smith.edu:public_html/lab0/ 
      If you have Windows you can either use Cyberduck or the Putty secure copy client here: pscp.exe

      Here is a tutorial on how to use this executable to copy files from a Windows machine to a Linux machine: PSCP tutorial The short version is very similar to Mac and Linux. In the Windows terminal (cmd), navigate to the folder where your code is and run:

       pscp HelloWorld.java username@aurora.smith.edu:public_html/lab0/ 
    • (Less recommended) Run the command
       emacs HelloWorld.java 
      and then paste in the contents of the above linked file.
  4. Now you are ready to compile, run, and submit your code. If you have logged off the server, log back on and follow the steps below, or use the video tutorial.
    cd public_html/lab0/
    javac HelloWorld.java
    java HelloWorld
    rsubmit lab0 HelloWorld.java
    If everything went well and you saw the message, you have completed Lab 0!