Chapter 00: Tool Setup
September 30, 2025 | Next part |
This chapter details the setup process for installing Java and Visual Studio Code on your system. It’s a suggested way of doing things, although there are many different ways to do this.
Software
The required software for this course is Visual Studio Code (a free code editor built by Microsoft) and the Java Development Kit (programming language and runtime).
- Download Visual Studio Code (VSCode) for your platform.
- Java Development Kit (JDK) - See Below for Download Link.
You’ll also use these tools, which you don’t need to install:
- OneDrive
- A Command Line Interface (CLI) tool:
- PowerShell on Windows.
- Terminal on macOS.
Software Install Tasks
- Install VSCode.
- Tip: When installing VSCode on Windows, on the Select Additional Tasks page, select the boxes for Add “Open with Code” to Windows Explorer file context menu and Add “Open with Code” to Windows Explorer directory context menu.
- After first class: Familiarize yourself with VSCode by completing the Get started with Visual Studio Code tutorial.
- Read the Visual Studio Code tips and tricks article.
- Learn how to access the Command Pallet (Ctrl+Shift+P).
VSCode Configuration
- Install the following Java Extensions:
- 📦 Language Support for Java™ by Red Hat: for code navigation, autocompletion, refactoring and code snippets.
- 📦 Project Manager for Java: enables a project explorer view, facilitating creation of packages, classes and libraries dependencies.
- 📦 Debugger for Java: Run and Debug Java projects.
Download and Configure Java
Java is straightforward to download, but we must configure VSCode to use it.
- Download Java for your platform:
- Windows x64 - microsoft-jdk-21.0.8-windows-x64.zip
- macOS Apple Silicon - microsoft-jdk-21.0.8-macos-aarch64.tar.gz
- For other platforms or more information, see Download the Microsoft Build of OpenJDK.
- Extract to a Specific Location:
- Windows:
- Create a new folder, e.g.,
C:\Program Files\Java\
. You might need admin rights to create this top-level folder. - Open your Downloads folder.
- Right-click
microsoft-jdk-21.0.8-windows-x64.zip
and select Extract All.. - For Select a Destination and Extract Files, type:
C:\Program Files\Java\
- This creates a folder in that location called:
jdk-21.0.8+9
. - The full path to the JDK would then be:
C:\Program Files\Java\jdk-21.0.8+9
. - Alternative (User-specific, no admin required): Extract to a folder inside the user’s home directory, e.g.,
C:\Users\YourUser\Java\jdk-21.0.8+9
.
- Create a new folder, e.g.,
- macOS:
- Create a folder called
/Users/Shared/Java/
. - In your Downloads directory, double click the
microsoft-jdk-21.0.8-macos-aarch64.tar.gz
file to unzip it. This creates a folder in your Downloads directory calledjdk-21.0.8+9
. - Move the
jdk-21.0.8+9
folder into/Users/Shared/Java/
, so in finder you can see/Users/Shared/Java/jdk-21.0.8+9/Contents/Home
.
- Create a folder called
- Windows:
- Add Java to your system path (Windows):
- In Windows, press the Windows key and type Env.
- Open Edit the system environment variables.
- Click Environment Variables…
- In the bottom half of the window, under System variables, double-click the row that says Path.
- Add the following entry:
C:\Program Files\Java\jdk-21.0.8+9\bin
- Configure VS Code:
- Open VS Code.
- Go to
File > Preferences > Settings
(orCode > Settings > Settings
on macOS). - Search for
java.configuration.runtimes
. - Click “Edit in settings.json”.
- Add the following entry (adjust path for your specific installation):
Windows:
{
// Java JDK Configuration
"java.configuration.runtimes": [
{
"name": "JavaSE-21",
"path": "C:\\Program Files\\Java\\jdk-21.0.8+9",
"default": true
}
],
"java.jdt.ls.java.home": "C:\\Program Files\\Java\\jdk-21.0.8+9",
"java.server.launchMode": "Standard"
}
macOS:
{
// Java JDK Configuration
"java.configuration.runtimes": [
{
"name": "JavaSE-21",
"path": "/Users/Shared/Java/jdk-21.0.8+9/Contents/Home",
"default": true
}
],
"java.jdt.ls.java.home": "/Users/Shared/Java/jdk-21.0.8+9/Contents/Home", // Must match the above path
"java.server.launchMode": "Standard",
}
- Important: Remember to use double backslashes
\\
in Windows paths within JSON.
- Restart VS Code: Close and reopen VS Code for the changes to take full effect.