These instructions assume that you have already activated your CS account.
- Login to one of the Linux workstations.
- Create folders for your coursework.
- Create documents using LibreWriter.
- Create Java projects using Eclipse.
- Run Java programs from the command line.
- Logout when you're done.
Login to one of the Linux workstations
See CS Instructional Labs page for room numbers.
- Select an open workstation (computer).
- Move mouse or type key to wake up the computer and get a login prompt. If the computer is locked, choose a different workstation. If there is no other workstation, email lab that there is a computer locked without a user.
- Type your CS username and press Enter.
- [First login only] choose a desktop environment. This document assumes the Ubuntu (default) desktop is chosen.
- Type your CS password and press Enter.
- Wait for the chosen environment to finish setting up.
- [Optional] Read keyboard shortcuts page for some ideas about what shortcuts are available.
Create folders for your course work
- Click the File icon. (2nd from top of left navigation menu)
- Click the private folder to open this file folder. (files and folders in private are not visible to other users)
- Right-click in the blank space of your private folder.
- Select New Folder option to create a new folder within your private folder.
- Type cs400 and press Enter to create a folder for your cs400 work. Create folders for other courses if you like.
- Double-click the cs400 folder to open the folder you just created.
- Create a folder named programs (to store programming project work).
- Create a folder named homeworks (to store your homework solution work).
Create a homework document using LibreWriter
- Click the LibreWriter icon. (looks like text document in left nav menu--hover to confirm)
- Type the following information at the top of the homework page:
- Homework #1
- Your name
- Your NetID
- Homework 1
- Due Date and Time.
- Save the file. (Click the Save icon)
- Select your private/homeworks folder (that you created earlier).
- Type h1 for the name of your file.
Note: it aids our grading process "scripts" for all students to use the same file names -- trust us, h1 is a good name for this file.
- Click the Save button to save the file with this name in the chosen folder.
- Export to PDF (this is required for homework submissions)
- Re-Open your private/cs400/homeworks/h1.odt file.
(This is your LibreWriter file in private/cs400/homeworks folder)
- Click Export Directly as PDF.
- Keep h1 as the file name. It will save as h1.pdf.
- Keep file type as Portable Document Format (pdf).
- Click Save to generate the pdf for your homework file.
- Check that h1.pdf is in your private/homeworks folder.
- Upload your h1.pdf file to your Homework 1 handin folder on Canvas.
- Note: any time you make changes to your h1.odt document, you must re-save and re-export to PDF for the changes to be re-published to the PDF format.
- Return to this file, double-click to open, and then continue work on your homework assignment document. Be sure to save often while working on your homework documents.
Create a programming project using Eclipse
- Open a terminal window
- Type eclipse &
- Select a workspace folder (I recommend ~/private/cs400/workspace)
- Create a Java Project named prep2
- Add classes as needed for your project.
- Edit
- Compile and Run your program
Run a Java program from the command line
Try It! You'll Like It!
- Open a terminal window
- cd to your program project's folder if it is already written (linux command is: cd ~/private/cs400/workspace/prep2/ )
- If you must edit your program source code, try one of these editors
- pico (very easy to use)
pico MyProgram.java
- nino (also easy to use)
nino MyProgram.java
- emacs (many like this editor)
emacs MyProgram.java
- vi (or vim - my personal favorite)
vi MyProgram.java
You will need to learn about modes to use vi - here's a tutorial to help you get started. Or, google vi tutorial to find many more.
- Java programs must be compiled and linked before they can be run. One command compiles and links all source in the current directory.
javac *.java
- Use Java to run your program with command line arguments. This example has three command-line arguments (1 2 3).
java MyProgram 1 2 3
Logout
- Click the Settings gear icon. (Upper right corner of the desktop window)
- Click the Log Out option
- Confirm Log Out (Don't lock CS workstations unless you are just going to get printout or to a restroom).