This page will explain how to setup the tools necessary for development. The tools necessary for development are:
The tools you will need to install and configure are:
Please don’t hesitate to ask for help on the course Piazza if you have any problems setting up the environment.
As the projects are to generate code in x86_64 assembly, the projects will be tested on an x86_64 Linux server. Thus, developing on non-x86_64 non-Unix-like platform is possible but not recommended. Win10/11 users often find WSL useful. Alternatively, consider using a LWSN server.
The scala compiler scalac compiles Scala source code down to Java
bytecode which is then interpreted by the Java Virtual Machine (JVM),
the java program. Additionally, sbt (the Simple Build
Tool) is often used to manage and build the projects. For this course,
we are using the following versions,
Note that Scala 3.x or Scala 2.13.x will not work for this course. However, sbt manages the
Scala version for each project individually, so it is optional to ensure the
correct version of Scala installed. Using other versions of java or sbt may
work, but does not guarantee passing the tests when grading.
Installation instructions for these tools are as follows.
If you are working on a Lab Machine, check if tools have already been installed first.
Coursier is a tool for getting Scala applications and artifacts.
The following command works on x86-64 Linux and
will install JDK 17, the Scala REPL scala and sbt.
curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz" | gzip -d > cs
chmod +x cs
# Remove `--jvm temurin:17` if you already have a system-level JDK 17.
./cs setup --jvm temurin:17 -y --apps sbt:1.10.5,scala:2.12.18,cs
rm cs
After running the program above, make sure to close the terminal and open a new terminal window for the next commands. You should be able to invoke the java virtual machine in a Terminal (or Command Prompt):
$ java -version
openjdk version "17.0.17" 2025-10-21
...
and also the standalone scala:
$ scala -version
Scala code runner version 2.12.18 -- Copyright 2002-2023, LAMP/EPFL and Lightbend, Inc.
You should be able to invoke sbt. To test, run the sbt command
in a project folder (e.g. proj1/). After some downloads, the sbt repl should
start
$ cd proj1
$ sbt
[info] [launcher] getting org.scala-sbt sbt 1.10.5 (this may take some time)...
# ......
[info] Set current project to root (in build file:/)
[info] sbt server started at local:///root/.sbt/1.0/server/e656f0eb572233bacf5f/sock
sbt:root>
You can close the sbt program through Ctrl+D or closing the terminal
window. The command above will generate the target and project
directories. It is safe to delete both directories.
As an alternative to Coursier, you may also use SDKMAN!
to manage JVM-related environments. We recommend using java 17.0.13-tem
from SDKMAN.
Although it would be possible to compile projects manually using the
scalac command, scala projects use the sbt tool and have the
following directory structure.
my-app
├── build.sbt
└── src
├── main
│ └── scala
│ ├── util_package
│ │ └── Lib.scala
│ └── Main.scala
└── test
└── scala
└── util_package
The build.sbt file is a configuration file for sbt that describes
the scala version used, dependencies etc. Source files are usually found
under src/main/scala. This directory denotes that the source files are
Scala code. Similarly to Java, package hierarchy is reflected in the
directory structure.
These tools depend on the operating system you will be using. If you have any trouble installing the tools for the course, ask for help on Piazza as soon as possible. TAs or other students might help troubleshoot and solve your issue. If all suggestions fail, setup your machine for remote development as described in Remote development with VSCode on LWSN servers
If you are using a Debian-base distribution of Linux, you may want to install the build-essential package:
sudo apt-get install build-essential # compiler
sudo apt-get install gdb # debugger
sudo apt-get install manpages-posix # docs
sudo apt-get install manpages-posix-dev # docs
The last three packages are optional, but we strongly advise installing them.
For RedHat-based distributions use the yum installer:
yum groupinstall "Development Tools"
For MacOSX use homebrew:
brew install gcc
brew install gdb
Please follow steps 3 and 4 of the Prerequisites section at this link and install gcc, gdb, make and bash. With these you should be able to fire up a unix-like prompt to compile your programs
Once the installation is successful, you should be able to invoke gcc, make and gdb.
Development for this course can be done using any text editor, but for Scala, language server support can be very beneficial. Consider configuring Metals for your editor, or using the full setup of IntelliJ IDEA.
IntelliJ might be unideal on remote or low-resource machines. In this cases it is possible to use a lightweight editor with the Metals plugin. Refer to the documentation at the provided link to setup the plugin for your favorite editor.
Some editors come with good LLM support. We encourage you to discuss with models to enhance your understanding of concepts and the codebase, but we ask that you do not submit code produced by models. Using LLM is not a valid answer to academic integrity question marks.
A popular IDE for Scala is IntelliJ, which you can find
here. We advise installing
the Ultimate edition and to apply for a free student license
here. Always make sure to have the
latest version installed. Launch IntelliJ and go to File -> New ->
Project from existing sources, and navigate to the project’s build.sbt
file. Choose the Java 17 as the project’s SDK. In case Java was
not installed before running the installation steps for Scala, set the
Java SDK to the directory shown when running the cs java-home command
on a terminal window
The simplest way is to import the project as an ‘sbt project’. Be sure to check ‘sbt shell’ in the import settings.
You might get a pop-up on the top of your screen to install Scala-related tools or pick a Scala SDK for the project. Make sure to configure them and you’re good to go.
It is highly recommended that you use versioning control tools like Git: They help you track your editing history, especially helpful when you are experimenting or making temporary edits for debugging. For more, see materials from GitHub.
If you choose to use Git, please be careful:
.git folder :)If your local environment is not suitable for development, you can use a LWSN server instead. Your options include:
pod1-[1-20].cs.purdue.edu, e.g. pod1-1.cs.purdue.edumc[18-21].cs.purdue.edu, e.g. mc18.cs.purdue.eduYou need ssh to connect to these machines using your Purdue login, see
here.
Off campus access requires jumping via data.cs.purdue.edu, e.g.
ssh -J <user>@data.cs.purdue.edu <user>@pod1-<num>.cs.purdue.edu
If you use OpenSSH, you can simplify your workflow by configuring your
~/.ssh/config with the following entry, after which you can connect with
ssh <a-good-name-for-your-dev-host> (replace it with an actual name, of course).
This configuration also works for tools like VSCode.
Host <a-good-name-for-your-dev-host>
User <your purdue login>
HostName <e.g. mc18>.cs.purdue.edu
Port 22
ProxyCommand ssh -W %h:%p <your purdue login>@data.cs.purdue.edu
ForwardAgent yes
You may want to configure SSH keys to avoid typing password on each login; see here.
Follow the steps below to start your development on servers:
To retrieve files from the server, you may use scp or sftp.
Alternatively, we recommend you set up a private repository on Git hosting
providers (e.g. GitHub, GitLab, BitBucket) to sync your code.
Congratulations, you’ve set up the tools you will use for CS352!