Students will be able to (1) perform basic operations on their command line (terminal) application, (2) create repositories on GitHub, (3) perform basic operations with Git on the command line, (4) install and use a text editor, and (5) use the command line to compile and run Java programs.
Chapter 1 in the Git Book.
As a new CMSI 186 student, you wish to get your laptop’s development environment in great shape up front so you can work efficiently, have more leisure time, get more sleep, and maximize your learning.
Create a Slack account with your LMU email address and join the workspace lmucs.slack.com. Once joined, you can use Slack on the web or install an app. Send me a direct message so I can invite you to our class private channel #cmsi-186-04-spring-2020
where you can keep abreast of important announcements and participate by sharing questions and answers with your classmates.
Locate your terminal application:
Now, launch your command line app (Terminal on Mac, Git Bash on Windows). Practice with the following commands, in order, making a note of what they do:
pwd cd pwd clear ls mkdir cmsi186 cd cmsi186 pwd
Install a good, modern text editor if you don’t already have one. My favorite is VS Code and my second favorite is Atom. Both of these come with excellent extension packages for working with Java; install the most popular one for your editor (you’ll be glad you did).
The extension packs provide syntax highlighting, auto-suggestions, formatting, and much more. If you do a web search for how to install such a package and how to have your code automatically formatted, you will be so much more productive, and you won’t lose any points for poorly formatted code, and your online presence on GitHub will look very professional.
Setting up a development environment does take some time, and the process varies from person to person, machine to machine, so we might have to do a lot of your set up in person. Do what you can, but don’t get frustrated if the task seems overwhelming. Ask for help if you need it!
Make sure Git is installed and running on your laptop. If you are on Windows, and you have been following instructions to this point, you have already installed Git Bash (if you didn’t, reread the instructions above: you were asked to do this), and Git Bash already has Git installed. If you are on a Mac, Git is probably already installed; if not, do a web search for “download git for mac” and do the installation according to the instructions.
If you have done a fresh install of Git, you might have to exit and restart your terminal application to see that it is available. In the console, enter:
git
and make sure you don’t see any errors saying git
cannot be run.
Sign up for GitHub if you don’t already have an account.
Get set up and create your first repository (“story”), following these notes. (Make sure you go through the one-time git configuration, otherwise your work won’t be counted accurately on your GitHub profile.)
Strongly consider adding a profile picture to your GitHub profile, if you haven’t already. It looks much more professional than those silly blocky auto-generated things.
Go through my notes on Getting Started with Java, where you will learn how to execute Java programs in an online playground, download and install Java on your own laptop, and run the JShell application on your computer.
Make sure you have Java 13 or later.
Create a new (public) repository called cmsi-186-lab-0, making sure you initialize your repository with a README, and allow GitHub to create a .gitignore for you: choose Java from the .gitignore menu. Clone your newly created repo. In the folder attached to the repository, write Greeter.java containing the following code:
public class Greeter { public static void main(String[] args) { System.out.println("Hello World!"); } }
Compile and run, making sure the program works (instructions are in the Java Getting Started notes linked above). Commit (with a good commit message), then push.
Online:
On hardcopy or email, answers to the following: