Programming Environment Setup


Select Your Operating System

Ubuntu Linux

Mac OS X

Windows

Ubuntu Linux

Launch a terminal and run the following commands:

Change to your home folder.

$ cd $HOME

Install OpenJDK, ant, and spim.

$ sudo apt-get install openjdk-17-jdk ant spim

Create workspace folder.

$ mkdir workspace

Set the environment variable j.

$ echo "export j=$HOME/workspace" >> $HOME/.bashrc

Download and install IntelliJ (Community Edition).

To test your environment, download and unzip the base j-- compiler under ~/workspace, launch IntelliJ and open ~/workspace/j--, and run the following commands on the IntelliJ terminal:

$ ant
$ bash ./bin/j-- tests/jvm/HelloWorld.java
$ java HelloWorld
$ bash ./bin/j-- -s naive tests/spim/HelloWorld.java
$ spim -f HelloWorld.s

Mac OS X

Launch a terminal and run the following commands:

Change to your home folder.

$ cd $HOME

Install brew.

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install OpenJDK, ant, and spim.

$ brew install openjdk@17 ant spim

Create workspace folder.

$ mkdir workspace

Set the environment variable j.

$ echo "export j=$HOME/workspace" >> $HOME/.zshenv

Download and install IntelliJ (Community Edition).

To test your environment, download and unzip the base j-- compiler under ~/workspace, launch IntelliJ and open ~/workspace/j--, and run the following commands on the IntelliJ terminal:

$ ant 
$ zsh ./bin/j-- tests/jvm/HelloWorld.java 
$ java HelloWorld 
$ zsh ./bin/j-- -s naive tests/spim/HelloWorld.java 
$ spim -f HelloWorld.s 

Windows

Launch a powershell terminal and run the following commands:

Change to your home folder.

$ cd $HOME

Create workspace folder

$ mkdir workspace

Set the environment variable j.

$ setx j "$HOME\workspace"

Download and unzip OpenJDK 17 for Windows under some folder, say C:\jdk17. Run the following commands in a powershell terminal:

Set the environment variable JAVA_HOME.

$ setx JAVA_HOME "C:\jdk17\bin"

Update the environment variable PATH to include the C:\jdk17\bin folder.

$ setx PATH "$env:PATH;C:\jdk17\bin"

Download and unzip Ant under some folder, say C:\ant. Run the following command in a powershell terminal:

Update the environment variable PATH to include the C:\ant\bin folder.

$ setx PATH "$env:PATH;C:\ant\bin"

Download and install QtSpim.

Download and install IntelliJ (Community Edition). Launch IntelliJ, go to ConfigureSettingsToolsTerminal, and set Shell path to powershell.

To test your environment, download and unzip the base j-- compiler under ~/workspace, launch IntelliJ and open ~/workspace/j--, and run the following commands on the IntelliJ terminal:

$ ant 
$ ./bin/j-- tests/jvm/HelloWorld.java 
$ java HelloWorld 
$ ./bin/j-- -s naive tests/spim/HelloWorld.java 

Run the HelloWorld.s file generated by the previous command using QtSpim.