Skip to content

How to Use VSCode with MOOC.fi Java Course (Instead of NetBeans)

The Problem

I wanted to take the University of Helsinki’s MOOC.fi Java programming course, but the course materials heavily recommend NetBeans. I already use VSCode for everything else - Python, JavaScript, Markdown. I didn’t want to install another heavy IDE just for one course.

I searched for alternatives. Reddit threads mentioned VSCode works with MOOC.fi, but the instructions were scattered. Some said “just copy-paste to NetBeans when done” which sounded tedious.

The question was: Can I actually use VSCode with full MOOC.fi integration, or would I be stuck with a crippled workflow?

Environment

  • macOS (same process works on Windows/Linux)
  • VS Code 1.85+
  • Java 17 (OpenJDK)
  • No NetBeans installed

What I Found

MOOC.fi officially supports VSCode through the TMC (Test My Code) extension. This wasn’t obvious from the course landing page, which pushes NetBeans heavily. But after digging, I found official documentation at mooc.fi/en/installation/vscode/.

The TMC extension handles:

  • Downloading course exercises
  • Running local tests
  • Submitting solutions to the TMC server
  • Tracking progress

This meant I could use VSCode without sacrificing any course functionality.

The Setup Process

Step 1: Install Java Development Kit

First, I needed JDK. I checked if I already had it:

terminal
java -version

If you see “java: command not found”, you need to install it.

On macOS:

terminal
brew install openjdk@17

On Windows:

terminal
choco install openjdk

On Linux (Ubuntu/Debian):

terminal
sudo apt install openjdk-17-jdk

Verify installation:

terminal
java -version
javac -version

I saw something like:

output
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Homebrew (build 17.0.9+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.9+0, mixed mode, sharing)

Step 2: Install Java Extensions in VSCode

I opened VSCode and installed the Extension Pack for Java. This bundle includes:

  • Language Support for Java (Red Hat)
  • Debugger for Java
  • Test Runner for Java
  • Maven for Java
  • Project Manager for Java
  • IntelliCode

Quick install via Command Palette (Cmd+Shift+P / Ctrl+Shift+P):

Command Palette
ext install vscjava.vscode-java-pack

After installation, VSCode took a minute to download and initialize the Java Language Server. I saw a notification saying “Opening Java Projects…” in the status bar.

Step 3: Install TMC Extension

This is the key piece. The TMC (Test My Code) extension connects VSCode to MOOC.fi’s exercise system.

Install via Quick Open (Cmd+P / Ctrl+P):

Quick Open
ext install moocfi.test-my-code

Alternatively, search for “Test My Code” in the Extensions panel (Cmd+Shift+X).

After installation, I saw a new “TMC” icon in the Activity Bar (left sidebar). This is the TMC Commands panel.

Step 4: Configure TMC

I opened the TMC panel and clicked “Login”. The extension prompted for my mooc.fi credentials. If you don’t have an account, create one at mooc.fi (free).

After logging in, I needed to select a course:

  1. Click “Select Course” in the TMC panel
  2. Choose “Java Programming I” or “Java Programming II”
  3. Select your organization (University of Helsinki or other partner)

Then I downloaded exercises:

  1. Click “Download Exercises”
  2. Choose a folder location (I used ~/Projects/mooc-java)
  3. Select which week’s exercises to download (start with Week 1)

Step 5: Understanding the Project Structure

The TMC extension created this structure:

Project Structure
mooc-java/
├── src/
│ └── Part01/
│ └── Part01_01.Sandbox/
│ ├── src/
│ │ └── Main.java
│ └── test/
│ └── MainTest.java
├── lib/
│ └── junit-4.10.jar
└── .tmcproject.yml

Each exercise has:

  • src/ - Your code goes here
  • test/ - Hidden tests (you don’t see these before submission)
  • .tmcproject.yml - TMC configuration

Important: Open the project folder in VSCode (not individual files). The Java Language Server needs the folder context to work properly.

Step 6: Completing an Exercise

I opened Part01_01.Sandbox/src/Main.java:

Main.java
public class Main {
public static void main(String[] args) {
// Write your code here
}
}

I wrote a simple solution:

Main.java
public class Main {
public static void main(String[] args) {
System.out.println("Hello MOOC!");
}
}

Step 7: Running Tests

In the TMC panel, I clicked “Run Tests”. The extension ran local tests and showed results in the output panel.

output
TMC: Running tests for Part01_01.Sandbox...
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< tmc:Part01_01.Sandbox >----------------
[INFO] Building Part01_01.Sandbox 1.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:java (test) @ Part01_01.Sandbox ---
Running tests...
Tests: 1, Failures: 0, Skipped: 0
[PASS] All tests passed!

When tests passed, I clicked “Submit to Server” in the TMC panel. The extension uploaded my solution and I got feedback:

output
TMC: Submitting to server...
Submission accepted!
Points: 1/1
You can view the submission at: https://tmc.mooc.fi/submissions/...

Common Issues I Hit

Issue 1: Java Language Server Not Starting

After opening the project, I saw errors like “Java Language Server crashed” or no autocomplete.

The problem: VSCode didn’t recognize the project as a Java project because I opened it as a folder, not specifically configured for Java.

Fix:

  1. Make sure you opened the folder (File > Open Folder), not just a file
  2. Check if JDK is in your PATH: java -version
  3. Reload VSCode window: Cmd+Shift+P > “Developer: Reload Window”
  4. If still broken, check the Java extension is enabled

Issue 2: TMC Extension Won’t Connect

The TMC panel showed “Not logged in” repeatedly even after entering credentials.

The problem: Credentials weren’t saved or network was blocked.

Fix:

  1. Logout first: TMC panel > “Logout”
  2. Login again with correct credentials
  3. If using a corporate network, check if firewall blocks tmc.mooc.fi
  4. Clear TMC cache: Cmd+Shift+P > “TMC: Clear Cache”

Issue 3: Tests Fail Locally but Pass on Server

This happened when my solution had timing issues or platform-specific code.

The problem: Local test environment differs slightly from TMC server.

Fix:

  1. Don’t rely on system-specific paths or timing
  2. Make tests deterministic (no random values without seeds)
  3. Check the TMC output for specific error messages

Issue 4: Wrong Java Version

I got errors about Java version incompatibility.

The problem: The course exercises target Java 8+, but I had a different version configured.

Fix in settings.json:

.vscode/settings.json
{
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "/path/to/jdk-17",
"default": true
}
]
}

VSCode vs NetBeans for MOOC

After using VSCode for a few weeks, here’s my comparison:

FeatureVSCodeNetBeans
Startup time~2 seconds~10 seconds
Memory usage~400MB~800MB
TMC integrationFull supportFull support
Learning curveMediumHigher
Extensions30,000+~1,500
Industry adoptionVery highModerate

VSCode advantages:

  • Lightweight - runs well on older hardware
  • Same editor for Java, Python, JavaScript
  • Excellent Git integration built-in
  • IntelliCode for AI-assisted completions
  • Larger community = more Stack Overflow answers

NetBeans advantages:

  • Course materials reference it directly
  • Zero setup - works out of the box
  • Better Java-specific refactoring tools
  • More integrated Maven support

If you’re already comfortable with VSCode, stick with it. The TMC extension provides feature parity for the course.

The Architecture

Here’s how the pieces connect:

Architecture Diagram
┌─────────────────┐
│ VS Code │
│ (Your Editor) │
└────────┬────────┘
┌────┴────┐
│ │
▼ ▼
┌───────┐ ┌─────────────┐
│ Java │ │ TMC │
│ Pack │ │ Extension │
└───┬───┘ └──────┬──────┘
│ │
▼ ▼
┌───────┐ ┌─────────────┐
│ JDK │ │ TMC Server │
│ │ │ (mooc.fi) │
└───────┘ └─────────────┘
│ │
▼ ▼
┌───────────────────────┐
│ Your Java Exercise │
│ (.java files) │
└───────────────────────┘

The Java extension provides language support (autocomplete, debugging, error checking). The TMC extension handles exercise management (download, test, submit). They work together on your Java files.

Tips I Wish I Knew Earlier

Use Keyboard Shortcuts

I set up shortcuts for common TMC actions:

  • Cmd+Shift+T R - Run tests
  • Cmd+Shift+T S - Submit to server
  • Cmd+Shift+T D - Download exercises

Configure in VSCode’s Keyboard Shortcuts (Cmd+K Cmd+S).

Version Control Your Progress

I initialized Git in my mooc-java folder:

terminal
cd ~/Projects/mooc-java
git init
git add .
git commit -m "Initial commit"

After each exercise, I commit:

terminal
git add .
git commit -m "Complete Part01_01.Sandbox"

This saved me once when I broke my code and needed to revert.

Debug with Breakpoints

VSCode’s Java debugger works with TMC exercises. I can set breakpoints, step through code, and inspect variables. This helped me understand complex loops.

Click next to a line number to set a breakpoint, then F5 to start debugging.

Keep Extensions Updated

The TMC extension gets updates. Check periodically:

  1. Open Extensions panel
  2. Search for “Test My Code”
  3. Click “Update” if available

Updates fix bugs and add features.

Summary

I set up VSCode to work with MOOC.fi’s Java course using the TMC extension. The full integration means I can download exercises, run tests, and submit solutions without leaving VSCode.

The setup takes about 10 minutes:

  1. Install JDK
  2. Install Extension Pack for Java
  3. Install TMC extension
  4. Login to mooc.fi
  5. Download exercises

I avoided installing NetBeans, kept my familiar VSCode workflow, and maintained full course functionality. If you’re already a VSCode user, there’s no reason to switch IDEs for this course.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments