CMSI 2120/30 Dev Setup
Welcome to CMSI 2120! This page has setup instructions for the various technologies that we will need for the course.
Setup of the following is recommended by lecture L1-2 at the latest, and is *mandated* by lecture L2-2.
We will complete tutorials with how to use each of the following in-class and through assignments, but having them downloaded in advance will make the most out of your time in class.
Essentials
-
Download Java:
Get the latest JDK from the Java JDK Site (click here)
Run the install executable (.exe for Windows, .dmg for Macs) and follow the instructions on your screen.
Open either Terminal (Mac/Linux: CMD+Spacebar then search for Terminal) or Command Line (Windows: WINDOWS+R, then type
cmd, and enter).-
To test that the installation has succeeded, run the following commands (type these in the terminal one at a time then hit enter):
java -version javac
If you see no error messages from the above, you're all set!
-
Setup Git & GitHub:
If you haven't already, sign up for GitHub here
-
Note that Git has deprecated password authentication and requires you to authenticate using either ssh keys or auth tokens!
Even if you used GitHub in the past, you will need to configure a new authentication method such as here.
Download the
gitterminal tools here.If you are using a Windows computer, make sure to install Git Bash as part of the installation process in the above -- you'll use this instead of the basic command line for your terminal, as it just tends to work better for our objectives.
Open a new terminal/git bash window and type
gitand enter -- if you see a bunch of options pop up, you're good to go!
-
Download a plain text editor; good suggestions:
Sublime Text (my favorite for Mac)
Notepad++ (my favorite for Windows)
Vim (warning: steep learning curve, but my favorite for terminal)
Emacs (warning: steep learning curve)
Warning: You should NOT use Microsoft Word or other document processing software for your development, it will cause more trouble than good.
Highly Recommended
An Integrated Development Environment (IDE) is a program that bundles many helpers for software development, including: language-specific text editors, compiler warnings, code suggestions, debuggers, unit-test integration, and much more!
Warning: IDEs can be intimidating at the start, but you'll grow to love them as you gain comfort -- they're used all the time in industry, so it's good to get some experience with one now!
For this course, you'll want to choose an IDE on which to write Java source code. Here are my suggestions for such (in order of suggestion):
Environment |
Features |
Warnings |
|---|---|---|
|
|
|
|
|
|
|
|
|
* Note: I will be using Eclipse during class to show examples and run code, and HIGHLY suggest you use it too. It is the simplest lead-in to the topics in this class, and becoming familiar with an IDE is strongly recommended.
Do not worry about mastering an IDE in advance of the class -- we will see examples in Eclipse that translate to other development environments as well.
Eclipse Video Tutorials
Eclipse Setup Tutorial: the following video walks you through setting up Eclipse to develop Java applications, integrate with GitHub, and include the JUnit library on the build path.
Eclipse JUnit + Debugger Tutorial: take a look at how to use Eclipse's debugger and how it plays nicely with JUnit!
Eclipse + JUnit
This section of the tutorial applies to those using Eclipse as their primary development environment.
In order to run JUnit tests in Eclipse, it is fairly simple, but requires one extra step to ensure that the JUnit library is on the project's Build Path.
There are a number of ways to include JUnit on the project's build path, here's the simplest:
Right click on the Project Folder for which you want to run JUnit tests.
Select the Properties menu item then navigate to the Java Build Path on the left.
Find the Libraries tab, then click on the Class Path list. On the right bar, choose Add Library...
In the list of options, select JUnit, then add JUnit 4 to the build path.
Apply and close!
Note: the above requires that no module_info file be present in the project -- delete it if you created it, but preferrably, choose the "Don't Create" option when prompted upon Java project creation.
Troubleshooting
Sometimes (especially if you had some issues while setting up your project and needed to redo it) Eclipse gets confused and JUnit is not properly situated on the build path.
If you're getting an error related to the JUnit runner, try the following:
Right click on the project you're troubleshooting (the very top-level folder) and go to Properties
Find Java Build Path in the left panel and click on it
Click on the Libraries tab
Make sure that JUnit is under the Classpath icon (not Modulepath). If it's under the Modulepath, drag it to the Classpath. If it's not there at all, click on Classpath then Add Library on the right and find JUnit.
VSCode + JUnit
Follow the tutorial located at this link to set up JUnit with VSCode (Use Version 5 / JUnit Jupiter in the tutorial video with the Test Runner plugin).