Set up VS Code for SDPD

Three steps. Do this once. Then never again.

Once · ~10 min 📦 SDPD-Java-Labs.zip 🪟 Windows · 🍎 macOS · 🐧 Linux

VS Code on its own has a lot going on. We've packaged the few settings you need, the tasks for compiling Java, and a one-click extension install into a single ZIP. Three steps and you're done for the year.

The three steps

  1. Install VS Code and Java (skip if you’re on a lab PC)
  2. Download and unzip SDPD-Java-Labs.zip
  3. Double-click SDPD.code-workspace inside the unzipped folder. Done.

That’s it. No profiles, no menus, no five-screen import dialog. Read on for the detail.

Step 1 — Install VS Code and Java

Skip Step 1 if you’re on a lab PC — both are already installed.

VS Code

Go to code.visualstudio.comDownload → pick your operating system → run the installer. Accept all the defaults.

Java 21

Go to adoptium.net → download Temurin 21 (LTS) for your operating system → run the installer.

On Windows, make sure “Add to PATH” is ticked during install. On Mac/Linux this happens automatically.

Verify it worked. Open a terminal (Windows: search for “cmd”; Mac/Linux: Terminal) and run:

$ java --version openjdk 21.0.4 2024-07-16 LTS

As long as it says 21 somewhere, you’re good. If it says “command not found”, restart your computer and try again.

Step 2 — Download SDPD-Java-Labs.zip

⬇ Download SDPD-Java-Labs.zip
~3 KB · contains the workspace file, settings and tasks

Unzip it into the place you want your Java work to live. We recommend OneDrive:

  • Windows: sign in to OneDrive with your @atu.ie email. Move the unzipped SDPD-Java-Labs folder into OneDrive — Atlantic TU.
  • Mac: install OneDrive from the App Store, sign in with @atu.ie, drop the folder in.
  • Linux: anywhere on your home directory is fine.

Why OneDrive? Because lab PCs reboot and wipe local files. Anything in OneDrive follows you across lab sessions and back home.

After unzipping you should have this structure:

SDPD-Java-Labs/ ├── SDPD.code-workspace <-- this is the file you double-click ├── README.txt └── .vscode/ ├── settings.json └── tasks.json

(.vscode may be hidden by default on macOS and Linux. That’s fine — leave it alone, VS Code will find it.)

Step 3 — Double-click SDPD.code-workspace

After extracting, your SDPD-Java-Labs folder contains six visible items:

SDPD-Java-Labs/
  ├── README.md
  ├── SDPD.code-workspace ← double-click this
  ├── Week 01/
  ├── Week 02/
  ├── Week 03/
  └── Week 04/

Double-click SDPD.code-workspace. VS Code opens with all settings applied. Two things happen:

First, a notification appears in the bottom-right:

"This workspace has extension recommendations."
[Install] [Show Recommendations]

Click Install. Microsoft’s Extension Pack for Java downloads — takes 30–60 seconds. Progress appears in the bottom-left.

Second, the README opens automatically as a rendered preview tab — your week-by-week lab index. Don’t close it.

If the README doesn’t appear the first time, click README.md in the file tree on the left and press Ctrl+Shift+V to open the preview.

You should now see:

  • The title bar says SDPD-Java-Labs — no “(Workspace)” suffix
  • A README preview tab open with the lab index
  • Compact menu — single hamburger icon top-left, not File/Edit/View spelled out
  • No left rail of icons — Activity Bar moved to a small row at the top of the sidebar
  • No Copilot Chat panel anywhere (it’s killed by chat.disableAIFeatures — the panel doesn’t appear even if Copilot is installed)
  • No minimap, no breadcrumbs, no layout buttons anywhere
  • Single editor tab at a time (no tab pile-up)
  • Four pre-created Week folders in the file tree, ready for your .java files
  • The status bar at the bottom shows “Java: Ready” once the language server warms up

You’re done with setup.

Viewing a lab inside VS Code

The auto-opened README has two click targets next to every lab:

  • ▶ Open in VS Code — the lab page opens as a new tab inside VS Code, beside your code editor. Pin it (right-click the tab → Pin Tab) so it stays put as you create Java files. You end up with: lab content on the right, your code on the left, terminal at the bottom — everything you need on one screen.
  • In a browser — opens the lab page in your normal browser. Handy if you have a second monitor and want it bigger.
Workspace open in VS Code with a typical layout:
Left half: Hello.java editor · Right half: W1L1 lab page tab · Bottom: terminal showing Hello World!

If the ▶ Open in VS Code click doesn’t seem to do anything (some VS Code versions block command links in Markdown previews on first use), the In a browser link always works. There’s also a manual fallback: Ctrl+Shift+P → type Simple Browser: Show → paste the lab URL.

What goes inside SDPD-Java-Labs

Make a folder for each week’s work inside SDPD-Java-Labs. Your structure ends up looking like:

SDPD-Java-Labs/ ├── SDPD.code-workspace ├── .vscode/ ├── Week 01/ │ ├── Hello.java │ ├── Welcome.java │ └── Today.java ├── Week 02/ │ └── ... └── ...

The W1L1 lab page walks you through making the Week 01 folder and the three files inside it. No setup steps repeat — once you’ve done this page, you can start on Week 1 · Lab 1.

Compile and run

With a .java file open in VS Code, press F5. The terminal opens at the bottom and shows your program’s output.

Or — equivalent — Ctrl+Shift+B (the standard “build” shortcut). Both run the Compile and run current Java file task that came in the workspace.

If you prefer the mouse, the Java extension also adds a small ▶ Run link directly above the main method in your file.

Troubleshooting

  • Double-clicking SDPD.code-workspace opens it in Notepad / TextEdit / a text editor. Right-click the file → Open With…Visual Studio Code → tick “Always use this app”. Future double-clicks will open in VS Code.
  • The “Install” prompt for extensions didn’t appear. Open the Extensions panel manually: Ctrl+Shift+X, search for Extension Pack for Java, click Install.
  • F5 says “Cannot find runtime for current debug configuration”. The Java extension can’t find your JDK. Open the command palette (Ctrl+Shift+P) → type Java: Configure Java Runtime → pick your installed JDK 21.
  • VS Code asks “Do you trust the authors of the files in this workspace?” Click Yes, I trust the authors. (The workspace turns this prompt off for SDPD’s own files; first time only.)
  • Output doesn’t appear when you press F5. Make sure you’ve saved the file (Ctrl+S) — auto-save is on so this rarely happens. Check that the .java file’s class name matches the filename exactly (case-sensitive).
  • “javac is not recognised” — Java isn’t on your PATH. Re-run the Temurin installer (Windows) with “Add to PATH” ticked, or restart your terminal (Mac/Linux). Restart VS Code afterwards.

Where to ask

If setup doesn't work

In the lab: wave at your lab supervisor — they've seen every setup problem there is and most are fixed in two minutes.

From home: michael.duignan@atu.ie — include a screenshot of any error message and which step you're stuck on.