Last updated on
Tools Setup
We recommend using GNU/Linux or macOS for this course (this is what most of the staff uses). We will only offer best-effort support for Windows.
Make sure that the paths to your projects (the names of files, and folders that contain them, all the way up) do not contain spaces, special characters, or non-English letters. This is especially relevant on Windows, where, for instance, usernames containing spaces or special characters have caused issues in the past.
If you encounter an issue and cannot continue following the tools setup steps because of it, check out our Troubleshooting Guide and see if you can find the solution to your problem there.
Step 1: Install Scala
Follow the “Install Scala on your computer” section of the instructions on the Scala website.
At some point, the Coursier setup program will ask: “No JVM found, should we try to install one? [Y/n]”. Respond “y” (for “yes”) and press Enter / ⏎. Similarly, when it asks about updating the PATH
environment variable, respond “y”.
On macOS, you might need to first install the Homebrew package manager if it is not already installed.
On some Linux distributions (e.g. Ubuntu), you might see an error message, “curl: command not found”. In that case, use the following alternative command:
$ wget -qO- https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-pc-linux.gz | gzip -d > cs && chmod +x cs && ./cs setup
(The $
in the command above is called the prompt and isn’t part of the command. It’s a convention used to indicate that you should type the text after the $
sign and then press the Enter or ⏎ key to execute the command.)
Restart your computer after the installation.
Verify installation
To verify that Scala was installed correctly, run:
scala --version
If the installation was successful, it should print your Scala version.
Step 2: Install Visual Studio Code
Follow the instructions on the Visual Studio Code website for your operating system:
Step 3: Install Metals
Install the “Scala (Metals)” VS Code extension:
Step 4: Install git
Git is a version control system. You will learn more about it in the first software-engineering lecture. For now, you just need to install and configure it.
On Ubuntu and Debian
sudo apt update && sudo apt install git
On other Linux distributions
Use your distribution’s recommended package manager.
On macOS
brew install git
On Windows
Verify installation
To verify that Git was installed correctly, run:
git --version
If the installation was successful, it should print your Git version.
Step 5: Setup SSH Authentication with EPFL GitLab
Git needs to be configured with an “SSH Key” to be able access exercises and labs for this course.
It is expected that you do not yet understand everything that is going on while setting up an SSH key. We will learn more during Git lectures and exercises, later in the course.
When performing the below steps on Windows, make sure to use the Windows Terminal and not the Command Prompt.
Install OpenSSH
On Ubuntu and Debian
sudo apt update && sudo apt install openssh-client
On macOS and Windows 11
Nothing to do, OpenSSH is pre-installed.
On Windows 10
Enable “OpenSSH Client” from the “optional features” menu.
Prepare a key pair
We now need to create (or locate) a key to authenticate you with Gitlab, the code-sharing platform we use for the course.
Windows users: please run the commands below in the Git bash terminal.
First, check if you already have an SSH key pair by running the following command in your terminal:
ls ~/.ssh
If you see files named id_xyz
and id_xyz.pub
, you already have an SSH key pair and you can kip to the next section. If you don’t see these files, you need to generate a new SSH key pair.
To do so, you can run the following command in your terminal and follow the instructions:
ssh-keygen -t ed25519
You can leave the default path to which the key pair is saved.
This command creates a unique “digital identity”, in the form of a private key id_ed25519
and a public key id_ed25519.pub
stored in your ~/.ssh
directory. We will use this “key pair” to authenticate you to the gitlab.epfl.ch
server.
Add the SSH key to your GitLab account
Display the contents of the public key file (.pub
) by running the following command in your terminal:
cat ~/.ssh/id_ed25519.pub
This will print out your public key in the terminal. Copy it, then:
- Go to https://gitlab.epfl.ch, log in with your EPFL account.
- Once logged-in, open the sidebar on the left if not already open, click on your profile picture in the top-right corner of the sidebar and select “Preferences”. Alternatively, use this direct link.
- Click on “SSH keys” in the left sidebar.
- Click on the “Add new key” button.
- Paste your public key in the “Key” field, enter a title, and click on the “Add key” button.
- You should see your key in the list of SSH keys.
Check that SSH is working
To verify that you can log in using your key, you can run the following command in your terminal:
ssh -T git@gitlab.epfl.ch
If it’s the first time you connect to GitLab, you will this message: The authenticity of host 'gitlab.epfl.ch can't be established. Are you sure you want to continue connecting (yes/no)?
. Type yes
and press Enter
.
Then you can re-run the command and you should see this message: Welcome to GitLab, @your_username!
.
If you see this message, then Congrats! 🎉 It means SSH is working and you will be able to access exercises and labs.