Initial Tools Setup
Getting the JDK
Next, you will need to download the Java Development Kit (JDK). We will use the latest long-term support release, JDK 21, but any version newer than JDK 11 is fine too.
JDK for Windows
Go here to download JDK 21 for Windows. Click the download link next to “x64 Installer”. Run the downloaded program to install the JDK on your computer.
Updating Path for Windows
Next, Windows users will need to update their computer’s Path variable so it knows about the Java compiler you installed. Go to:
C:\Program Files\Java\jdk-21\binCopy the full path location.
(If you have a different version of the JDK, you may find a jdk folder with a different number. That’s fine.)
Then, press the Start Windows icon and type “environment variables”. You should see an option that says, “Edit the system environment variables.” In the popup dialog, select “Environment Variables…”
Under “System variables”, select “Path” and then click “Edit”. In the resulting dialog, click “New”.
Paste in the full address of the JDK (something like C:\Program Files\Java\jdk-21\bin). Press OK to finish adding to the path, then OK two more times to dismiss the other two dialogs.
Un-hiding file extensions
Windows will automatically hide extensions of known file types, like .java or .txt. This can sometimes lead to mistakes where it looks like a file is saved as something like Hello.java, but it is actually saved as Hello.java.txt. I highly recommend changing your settings so you can see these file extensions.
Press the Windows Start button, type Control Panel, and hit Enter. Click “Appearance and Personalization” and then “File Explorer Options”. Click “View” in the resulting dialog. Find the option that says “Hide extensions for known file types”. Uncheck that option, and click “Apply”.
JDK for macOS
Go here to download JDK 21 for macOS. Click the download link next to “ARM64 DMG Installer”. From either the browser Downloads window or the File browser, double click the .dmg file. This will open a Finder window with the “JDK 21.pkg” icon – double-click that to start the isntallation.
Note: if you have an older x64 version of macOS, you will want to use that download link instead.
VS Code
We will use the VS Code text editor to develop and run our Java programs. If you don’t already have VS Code installed, you can download it here. Click the download button associated with your operating system and install the downloaded file. When you install it, I recommend selecting the “Open with code” action for both files and directories.
VS Code extensions
There are several VS Code extensions associated with Java programs – namely, the “Extension pack for Java” and “Java by Red Hat”. We will not use either of these extensions in CIS 200 in order to focus on working with the terminal and the basics of how Java programs are compiled and run. You are welcome to install whatever extensions you want on your own computer, but make sure you test your programs with javac and java from the terminal (as that is how they will be graded).
Folder structure
In order to practice good organization, we will use a particular folder structure in CIS 200:
On the first day of class, you will clone a GitHub repository that contains the following folder structure:
- cis200repo
- tutorials
- labs
- projectsWe will use this repository for all class work. When you start on an assigned tutorial, lab, or project, you
will navigate inside the corresondping tutorials, labs, or projects folder and create a new folder for that assignment. (Individual assignments will give more details on naming requirements.) Inside your new assignment folder, you will create the files needed for that assignment.
I recommend that you store the top-level cis200repo folder on your One Drive to be able to easily access it from multiple locations, but you are welcome to store it anywhere.