Skip to content

Setting Up Your Java Development Environment

← Part 1 Overview

S7 Inf A3 — Java for Graphical and Mobile Programming
Stéphane Derrode — Centrale Lyon

Do this before your first lab session (TD1). The setup takes about 20–30 minutes. If you run into problems, bring your laptop to the first session and we will sort it out together.


What you will install

Tool Purpose Version
JDK 17 Java compiler & runtime 17 LTS
Maven Build tool & dependency manager 3.9+
VSCodium Code editor (open-source VS Code) latest
Extension Pack for Java Java support in VSCodium latest

Step 1 — Install JDK 17

Windows & macOS

  1. Go to https://adoptium.net
  2. Select Temurin 17 (LTS) and download the installer for your OS
  3. Run the installer — accept all defaults
  4. Open a new terminal and verify:
    java -version
    
    You should see something like: openjdk version "17.0.x"

Linux (Debian/Ubuntu)

sudo apt update
sudo apt install openjdk-17-jdk
java -version

If you have multiple Java versions installed: set JDK 17 as the default with sudo update-alternatives --config java (Linux) or by setting JAVA_HOME in your environment.


Step 2 — Install Maven

Windows

  1. Download the binary zip from https://maven.apache.org/download.cgi — choose apache-maven-3.x.x-bin.zip
  2. Unzip to a location like C:\Program Files\Maven\
  3. Add C:\Program Files\Maven\bin to your PATH environment variable:
  4. Search for "Edit the system environment variables" in the Start menu
  5. Click Environment Variables → select PathEditNew → paste the path
  6. Open a new terminal and verify:
    mvn -version
    

macOS

# Using Homebrew (recommended)
brew install maven
mvn -version

Linux (Debian/Ubuntu)

sudo apt install maven
mvn -version

Expected output:

Apache Maven 3.x.x
Java version: 17.x.x


Step 3 — Install VSCodium

  1. Go to https://vscodium.com
  2. Download and install the version for your OS
  3. Launch VSCodium

Why VSCodium and not VS Code? VSCodium is the open-source build of VS Code without Microsoft telemetry. It is functionally identical for our purposes.


Step 4 — Install the Java Extension Pack

  1. In VSCodium, open the Extensions panel:
  2. Click the puzzle-piece icon in the left sidebar, or press Ctrl+Shift+X (Cmd+Shift+X on macOS)

  3. In the search box, type:

    Extension Pack for Java
    

  4. Find the entry by VS Code Java Team (identifier: vscjava.vscode-java-pack) and click Install

This installs the following extensions automatically: - Language Support for Java (Red Hat) — syntax highlighting, autocomplete, refactoring - Debugger for Java — breakpoints, step-through debugging - Maven for Java — Maven project management directly in the editor - Java Test Runner — run JUnit tests from the editor

  1. When installation finishes, VSCodium may prompt you to reload — click Reload if asked.

Step 5 — Create your first Maven project

  1. Press Ctrl+Shift+P (Cmd+Shift+P on macOS) to open the Command Palette
  2. Type Maven: Create Maven Project and select it
  3. Choose maven-archetype-quickstart
  4. Select version 1.5
  5. Fill in the prompted fields:
  6. Group Id: com.s7infa3
  7. Artifact Id: td1
  8. Version: 1.0 (press Enter to accept default)
  9. Package: com.s7infa3 (press Enter to accept)
  10. Choose a folder where the project will be created (e.g. your Documents or Desktop)
  11. Confirm in the terminal that appears at the bottom — press Enter when prompted

Option B — Using the integrated terminal

  1. Open the integrated terminal: Terminal ▸ New Terminal (or Ctrl+`)
  2. Navigate to where you want to create the project, then run:
    mvn archetype:generate \
      -DgroupId=com.s7infa3 \
      -DartifactId=td1 \
      -DarchetypeArtifactId=maven-archetype-quickstart \
      -DarchetypeVersion=1.5 \
      -DinteractiveMode=false
    

Step 6 — Open the project in VSCodium

  1. In VSCodium: File ▸ Open Folder…
  2. Navigate to and select the td1/ folder that was just created
  3. VSCodium will detect the Maven project automatically — you should see a Java Projects panel appear in the left sidebar after a few seconds

Step 7 — Configure Java 17 in pom.xml

Open pom.xml (visible in the file explorer on the left) and replace its content with:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
         http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.s7infa3</groupId>
  <artifactId>td1</artifactId>
  <version>1.0</version>

  <properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
</project>

Save the file (Ctrl+S). VSCodium may show a notification — click Synchronize or Update if prompted.


Step 8 — Run your first program

  1. In the file explorer, open src/main/java/com/s7infa3/App.java
  2. You should see the main() method with System.out.println("Hello World!");
  3. Click the ▶ Run button that appears just above the main() method (or right-click → Run Java)
  4. The integrated terminal at the bottom should print:
    Hello World!
    

Congratulations — your environment is ready!


Useful VSCodium shortcuts

Action Windows/Linux macOS
Open command palette Ctrl+Shift+P Cmd+Shift+P
Open terminal Ctrl+` Cmd+`
Open extensions Ctrl+Shift+X Cmd+Shift+X
Format document Ctrl+Shift+I Cmd+Shift+I
Go to definition F12 F12
Quick fix / import Ctrl+. Cmd+.
Rename symbol F2 F2
Toggle comment Ctrl+/ Cmd+/
Run last program Ctrl+F5 Ctrl+F5

Troubleshooting

"java: command not found" or "mvn: command not found"
→ The tool is installed but not in your PATH. Restart your terminal after installation. On Windows, restart VSCodium entirely after changing environment variables.

VSCodium shows red squiggles everywhere / "Build path is incomplete"
→ Wait 30–60 seconds for VSCodium to finish indexing the project. If the problem persists: Ctrl+Shift+PJava: Clean Java Language Server Workspace → reload.

Maven download is slow or fails
→ Maven downloads dependencies from the internet on first use. Make sure you are connected to the network. On campus, check that the proxy settings are correct.

"Release version 17 not supported"
→ VSCodium is using an older JDK. Open Ctrl+Shift+PJava: Configure Java Runtime and set the project JDK to 17.