In principle, you can use CSIT and Hanna Neumann computer labs to work on your assignments, and we will also use them for the mid-term test and final exam. The computer labs have all the necessary software for the course installed. You should try to log in to a lab computer at least once and familiarize yourself with the environment there, so you are ready for the test and the exam.
However, you may prefer working on your assignments and other practice material on your own device, and you may want to participate in certain immediate exercises in the workshops. For those use cases, you will need the following software:
- Java JDK 23.
- git
- a text editor
- IntelliJ IDEA 2024.3 - the Community Edition is generally free, but you may also be eligible to use the Ultimate edition for free under a student license
IntelliJ IDEA is a powerful integrated development environment (IDE) for Java. We will not use it in the first few weeks of the course, but it will be very useful later.
Other options#
If installing the above software does not work on your computer for whatever reason, you can also try one of two other options to work on your own computer:
- A virtual lab machine: replicate the setup of our computer labs in a virtual machine running on your computer.
- Remote Access: especially in the earlier part of the class, you can do most things remotely on a terminal. Note that Windows now includes
ssh
directly.
Java JDK 23#
These instructions will make Java 23 the default Java version on your system. This is fine in most cases, but if you depend on an older Java version for other things you do, please seek help with your particular situation.
Windows
Windows#
We recommend that you set up the Windows Subsystem for Linux. If you already have WSL installed, please ensure that it is WSL 2 - if not, please upgrade. You can then follow the installation instructions for Linux below - this will help you follow along in workshops. You can additionally follow the instructions for Windows itself below.
Step 1: Download the JDK#
Go to the Java JDK 23 download page and download the zip file for Windows/x64.
Step 2: Extract and move the JDK#
Open the zip file (e.g. openjdk-23.0.2_windows-x64_bin.zip
) and click “Extract All”.
Pick a suitable location.
Almost any place is fine for this purpose.
If you are unsure, make a new folder on C:\
, e.g. C:\progs
, and extract the zip file to there.
In that case, you should now have a folder called C:\progs\jdk-23.0.2
, which itself should contain the following folders:
bin
conf
include
jmods
legal
lib
The following two paths are relevant for our purposes, so copy them somewhere (e.g. into an editor window or notetaking application):
- the root folder (in our example,
C:\progs\jdk-23.0.2
) that contains the above folders. We’ll call this thehome
folder. - the
bin
subfolder in the above list (in our example,C:\progs\jdk-23.0.2\bin
). We’ll call this thepath
folder.
Step 3: Set the Environment Variables#
Open the start menu and start typing “Advanced”. You should be able to select something like “View Advanced System Settings”.
In the Advanced System Settings Menu, click “Environment Variables…”.
This menu is divided into two parts: “User variables” in the top half, and “System variables” in the bottom half. We are interested in the latter (System variables).
You should first check if there already is a variable called JAVA_HOME
.
If so, select it and click “Edit”.
Otherwise, click “New”.
You’ll get another dialogue to edit the name and value of the variable.
Make sure that the name is JAVA_HOME
, and the value corresponds to our home
folder we determined in step 2.
You can use the “Browse Directory…” button to find the folder, or copy in the path directly into the text box.
Second, look for the PATH
variable. It already exists and will likely look rather complicated. Select it and click edit.
This window looks a little different from before, in that it will show you a list of paths.
Click “New” to add a new path. A new entry appears at the bottom of the list.
Similar to before, you can use the “Browse…” button to find the directory, or copy in the location of what we remembered as the path
folder in Step 2 directly.
Then use the “Move Up” button to make sure the new path is at the top of the list, and confirm by pressing “OK”.
The PATH variable is a common convention in operating systems that lets everyone find certain programs. When you type a command like “java” in your terminal, the terminal will go through the list of paths in the PATH variable in order and try to find an executable file with that name in each of those paths, using the first one it finds.
Step 4: Test#
Open a new command-line (cmd
) or PowerShell window, and type
> java --version
The output should start with something like:
openjdk 23.0.2 2025-01-21
Make sure the version number starts with 23. If this does not work, first check the two main possibilities:
- You did not open a new command-line or powershell window (form the start menu). Applications that were already running when you changed the environment variables will not have gotten the update.
- Your changes to the environment variables were not saved. Go back to Step 3 and see if
JAVA_HOME
andPATH
are set correctly.
Linux
Linux#
We assume that you use Ubuntu as your distribution. Many other distributions work similarly, and if you have a different one, you most likely know what to do.
First, open a terminal. We assume you are using bash
, which is the standard terminal on Ubuntu and WSL.
If you are using a different terminal, you will need to do something different when we get to Step 3.
Step 1: Download the JDK#
In a browser, go to the Java JDK 23 download page.
There are two Linux versions, depending on your computer’s architecture - Intel/AMD CPUs need the x64
versions, ARM CPUs need the AArch64
version.
Right-click the tar.gz
links and click “Copy link”.
Go back to the terminal, and start entering curl
.
Then right-click into the terminal, which should paste the link you copied.
Finally, add ` -o java23.tar.gz` .
Your command should look something like:
curl https://download.java.net/java/GA/jdk23.0.2/6da2a6609d6e406f85c491fcb119101b/7/GPL/openjdk-23.0.2_linux-x64_bin.tar.gz -o java23.tar.gz
(Note, this is the command for the current link for the x64
version).
Press ENTER to run the command.
Step 2: Unpack and move the JDK#
To unpack the JDK, run the following command:
tar -xvzf java23.tar.gz
This will print a line for each file that has been unpacked.
What’s important is the first folder in these lines.
For example, if the last line is jdk-23.0.2/release
, then the JDK was unpacked to the folder jdk-23.0.2
.
If you want, you can leave the JDK where it is. If you started the terminal right before you did these steps, it will be in your home folder. You can also move it somewhere else to keep your home folder clean.
A simple place to remember is the /opt
directory, for optional software installs.
To move the JDK there, run:
sudo mv jdk-23.0.2 /opt/jdk-23.0.2
If applicable, replace jdk-23.0.2
with the name of the folder the JDK was unpacked to.
If prompted, enter your password. If you are on WSL on Windows, you would have set a separate password for Ubuntu when you first started WSL.
Whereever you put it, remember the last part of the last command as the java-home
folder.
We’ll need this in the next step.
If you decided to leave the JDK where it was, run the command
echo `pwd`/jdk-23.0.2
If applicable, replace jdk-23.0.2
with the name of the folder the JDK was unpacked to.
The output of this command is what you should remember as the java-home
folder if you did not move the JDK.
Step 3: Set the Environment Variables#
To make sure that you are in your user home directory, run
cd ~
Now use an editor to open your bash configuration file .bashrc
. We recommend using nano
.
If nano
is not already installed, you can install it by running
sudo apt update; sudo apt install nano
To open your bash configuration file with nano, run
nano .bashrc
Use the page-down and/or downarrow keys to scroll all the way to the bottom of the file. There, add the following three lines (in the same order, with an empty line at the end):
export JAVA_HOME=[your-java-home-folder]
export PATH=$JAVA_HOME/bin:$PATH
Replace [your-java-home-folder]
with whatever you remembered as the java-home
folder in Step 2.
The PATH variable is a common convention in operating systems that lets everyone find certain programs. When you type a command like “java” in your terminal, the terminal will go through the list of paths in the PATH variable in order and try to find an executable file with that name in each of those paths, using the first one it finds.
Press CTRL+X
to exit nano
. You then need to confirm that you want to save the file by pressing y
.
Run the command
source .bashrc
To have the changes you made applied to your current terminal session. You can instead also close the terminal and open a new one.
Don’t run the above source
command too often in one terminal session. It may pollute your path variable.
Step 4: Test#
Run
java --version
The output should start with something like:
openjdk 23.0.2 2025-01-21
Make sure the version number starts with 23. If this does not work, first check the two main possibilities:
- You did not either open a new terminal or run the
source
command. Applications that were already running when you changed the environment variables will not have gotten the update. - Your changes to the environment variables were not saved. Run
echo $JAVA_HOME echo $PATH
to see if your environment variables are set properly. Your path variable may contain a lot of other stuff, but should start with the
java-home
path we just set.
MacOS
MacOS#
First, open a terminal. We assume you are using zsh
, which is the standard terminal MacOS.
If you are using a different terminal, you will need to do something different when we get to Step 3.
Step 1: Download the JDK#
In a browser, go to the Java JDK 23 download page.
There are two MacOS versions, depending on your computer’s architecture - Intel/AMD CPUs need the x64
versions, ARM CPUs (all newer Macs) need the AArch64
version.
Right-click the tar.gz
links and click “Copy link”.
Go back to the terminal, and start entering curl
.
Then right-click into the terminal, which should paste the link you copied.
Finally, add ` -o java23.tar.gz` .
Your command should look something like:
curl https://download.java.net/java/GA/jdk23.0.2/6da2a6609d6e406f85c491fcb119101b/7/GPL/openjdk-23.0.2_macos-aarch64_bin.tar.gz -o java23.tar.gz
(Note, this is the command for the current link for the AArch64
version).
Press ENTER to run the command.
Step 2: Unpack and move the JDK#
To unpack the JDK, run the following command:
tar -xvzf java23.tar.gz
This will print a line for each file that has been unpacked.
What’s important is the first folder in these lines.
For example, if the last line is jdk-23.0.2.jdk/release
, then the JDK was unpacked to the folder jdk-23.0.2.jdk
.
If you want, you can leave the JDK where it is. If you started the terminal right before you did these steps, it will be in your home folder. You can also move it somewhere else to keep your home folder clean.
The standard place to put a JDK on MacOS is the /Library/Java/JavaVirtualMachines
directory.
To move the JDK there, run:
sudo mv jdk-23.0.2.jdk /Library/Java/JavaVirtualMachines/jdk-23.0.2.jdk
If applicable, replace jdk-23.0.2.jdk
with the name of the folder the JDK was unpacked to.
If prompted, enter your password.
Whereever you put it, remember the last part of the last command as the java-home
folder.
We’ll need this in the next step.
If you decided to leave the JDK where it was, run the command
echo `pwd`/jdk-23.0.2.jdk
If applicable, replace jdk-23.0.2.jdk
with the name of the folder the JDK was unpacked to.
The output of this command is what you should remember as the java-home
folder if you did not move the JDK.
Step 3: Set the Environment Variables#
To make sure that you are in your user home directory, run
cd ~
Now use an editor to open your bash configuration file .zshrc
. We recommend using nano
, which is installed on MacOS by default.
To open your zsh configuration file with nano, run
nano .zshrc
Scroll all the way to the bottom of the file. There, add the following three lines (in the same order, with an empty line at the end):
export JAVA_HOME=[your-java-home-folder]/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
Replace [your-java-home-folder]
with whatever you remembered as the java-home
folder in Step 2.
The PATH variable is a common convention in operating systems that lets everyone find certain programs. When you type a command like “java” in your terminal, the terminal will go through the list of paths in the PATH variable in order and try to find an executable file with that name in each of those paths, using the first one it finds.
Press CTRL+X
to exit nano
. You then need to confirm that you want to save the file by pressing y
.
Run the command
source .zshrc
To have the changes you made applied to your current terminal session. You can instead also close the terminal and open a new one.
Don’t run the above source
command too often in one terminal session. It may pollute your path variable.
Step 4: Test#
Run
java --version
The output should start with something like:
openjdk 23.0.2 2025-01-21
Make sure the version number starts with 23. If this does not work, first check the two main possibilities:
- You did not either open a new terminal or run the
source
command. Applications that were already running when you changed the environment variables will not have gotten the update. - Your changes to the environment variables were not saved. Run
echo $JAVA_HOME echo $PATH
to see if your environment variables are set properly. Your path variable may contain a lot of other stuff, but should start with the
java-home
path we just set.
Git#
Windows
Windows#
We recommend that you set up the Windows Subsystem for Linux. If you already have WSL installed, please ensure that it is WSL 2 - if not, please upgrade. You can then follow the installation instructions for Linux below - this will help you follow along in workshops. You can additionally follow the instructions for Windows itself below.
If it is not already installed, download the Git for Windows Standalone Installer. The installer will automatically update your PATH variable to include the right path to whereever you install Git.
Linux
Linux#
We assume that you use Ubuntu as your distribution. Many other distributions work similarly, and if you have a different one, you most likely know what to do.
Run the following commands:
sudo apt update
sudo apt install git
If prompted, enter your password. If you are on WSL on Windows, you would have set a separate password for Ubuntu when you first started WSL.
MacOS
MacOS#
Open a terminal and run the following command:
git
This will either display a lot of text starting with usage: git
, in which case git is already installed, or open up a dialog box that prompts you to install developer tools.
In the latter case, confirm the installation of developer tools.
A Text Editor#
We recommend that you use VSCode or VSCodium. If you are already using one of them and are using Codepilot or similar in it, we recommend that you separately install the other one and deactivate any such features.
You can use any text editor you like, but it should not have advanced Java support like auto-completion, or active Generative-AI features.
If you are using VSCode or VSCodium, do not install the Java extensions.
What’s the difference between VSCode and VSCodium?
Windows
Windows#
VSCodium#
For VSCodium, we recommend downloading the System Installer for Windows from the VSCodium Download Page.
Most likely you need the x86 64bits
version, but some newer Windows laptops are ARM-based (scroll down for ARM 64bits
).
You can run the system installer with the default options.
Once you open VSCodium, right-click on an empty space in the top-menu bar and ensure that the “Copilot Controls” checkbox is unchecked.
VSCode#
Download and run the System Installer for Windows from the VSCode Download Page.
Most likely you need the x64
verison, but some newer Windows laptops are ARM-based (in which case you can download the Arm64
version).
You can run the system installer with the default options.
Once you open VSCode, right-click on an empty space in the top-menu bar and ensure that the “Copilot Controls” checkbox is unchecked.
Linux
Linux#
We assume that you use Ubuntu as your distribution. Many other distributions work similarly, and if you have a different one, you most likely know what to do.
If you are using WSL on Windows, use the Windows instructions here. You can still use VSCod(e/ium) from WSL when it’s installed on Windows.
VSCodium#
Go to the VSCodium Download Page.
If you are on an Intel-based computer, the x86 64bits
table is for you.
If you are on an ARM-based computer, you need to scroll down to the ARM 64bits
table.
In either case, download the .deb
file for Linux.
Double-click the .deb
file in a file browser to open the installation screen for VSCodium:
Click Install
. You may have to confirm and/or enter your password.
After installation, you should see VSCodium in your applications list.
As of the date where this guide was written, it seems that the Linux version of VSCodium does not come with Copilot features by default. If you find them, deactivate them.
VSCode#
Double-click the .deb
file in a file browser to open the installation screen for VSCode:
Click Install
. You may have to confirm and/or enter your password.
After installation, you should see Visual Studio Code in your applications list.
As of the date where this guide was written, it seems that the Linux version of VSCode does not have the Copilot symbol in its top-menu bar. It does, however, advertise Copilot features for free. Do not set those up, and if you find active Copilot features, deactivate them.
MacOS
MacOS#
VSCodium#
Go to the VSCodium Download Page.
If you have an Intel-based Mac, the x86 64bits
table is for you.
For newer Macs (Apple Silicon), you need to scroll down to the ARM 64bits
table.
Download the MacOS VSCodium disk image (.dmg).
Double-click it, then drag VSCodium to your applications.
Once you open VSCodium, right-click on an empty space in the top-menu bar and ensure that the “Copilot Controls” checkbox is unchecked.
VSCode#
Download the appropriate zip file for your Mac’s architecture (Intel or Apple Silicon) from the VSCode Download Page. Drag this zip file into your applications folder to install it.
Once you open VSCode, right-click on an empty space in the top-menu bar and ensure that the “Copilot Controls” checkbox is unchecked.
IntelliJ IDEA#
IntelliJ IDEA is the recommended IDE for later in the semester. We will tell you when it makes sense to switch. For now, we recommend you install, but do not use it. It has a number of features that can cause severe mark penalties for you in the early assignments.
The default downloads on the IntelliJ IDEA website are for the Ultimate Edition, which is by default not free. You may be able to get a student license, but the free Community Edition is sufficient for this course. If you do have and are not planning to obtain a license for the Ultimate Edition, make sure to download the Community Edition from the “Other Versions” download page (also linked below).
Windows
Windows#
Download either the Windows x64 (exe)
(in most cases) or Windows ARM64 (exe)
(if you have an ARM-based computer) installers from the “Other Versions” download page, and run the installer.
After installing, start IntelliJ IDEA. On the start screen, select the Projects
tab on the left, scroll down to the category Local AI/ML Tools
, and make sure they are all disabled (you can potentially click “disable all”).
Linux
Linux#
We assume that you use Ubuntu as your distribution. Many other distributions work similarly, and if you have a different one, you most likely know what to do.
If you are using WSL on Windows, use the Windows instructions here. There is little point to using IntelliJ from WSL.
Download either the Linux x86_64 (tar.gz)
(in most cases) or Linux aarch64 (tar.gz)
(if you have an ARM-based computer) archives from the “Other Versions” download page.
Extract the tar-file, either by right-clicking the file in your file browser or using the tar -xzvf
command we used when installing the JVM.
Depending on how you extracted it, you may end up with up to two nested folders whose names contain “idea”, “IC”, and some version numbers.
Further inside, you will find a folder called bin
.
Inside this folder, you will find a file called idea.sh
.
In a file browser, you can right-click idea.sh
and select “Run as a program”.
In a terminal, go to that folder and run:
./idea.sh
Either way, IntelliJ IDEA will start.
After installing, start IntelliJ IDEA. On the start screen, select the Projects
tab on the left, scroll down to the category Local AI/ML Tools
, and make sure they are all disabled (you can potentially click “disable all”).
Optional: Add to PATH#
If you want to be able run IntelliJ from any directory in your terminal, you need to add this bin
directory to the path.
Make sure you are in your user home directory:
cd ~
Open the .bashrc
file:
nano .bashrc
Scroll all the way down, past the lines you added for the JDK. Add the following lines:
EXPORT PATH=/opt/intellijidea/bin:$PATH
Replace /opt/intellijidea/bin
with the path to whereever the bin
folder is located for your IntelliJ installation.
Press CTRL+X
to exit, and then y
to save the file.
After starting a new terminal instance, you should be able to run idea.sh
(notice the missing ./
) from anywhere.
MacOS
MacOS#
Download either the macOS Apple Silicon (dmg)
(in most cases) or macOS (dmg)
(if you have an Intel-based Mac) disk images from the “Other Versions” download page.
Once they are downloaded, double-click the file, and drag the application into your applications to install.
After installing, start IntelliJ IDEA. On the start screen, select the Projects
tab on the left, scroll down to the category Local AI/ML Tools
, and make sure they are all disabled (you can potentially click “disable all”).