Setting up the Development Environment - ihmcrobotics/ihmc-open-robotics-software-tutorials GitHub Wiki

Operating Systems

This setup was tested with

  • Windows 10
  • Ubuntu 16.04/18.04 (OUTDATED: not tested, instructions copied from previous wiki)

Install Java

Windows 10/11

If Java is already installed on your machine, ensure that it is at least Java 17. If you need to install Java, download it here: Java 17 Download. Make sure to install the Java Package "JDK", NOT the "JDK FX"!

Ubuntu 16.04/18.04 (OUTDATED)

Please check the Ubuntu specific instructions for a package source alternative.

OpenJDK You may decide to skip everything else in the "Install Java" section and install OpenJDK. For 16.04, simply run the following in a terminal:

 sudo apt-get install openjdk-8-jdk

For 18.04, we use the provided version 11:

 sudo apt-get install openjdk-11-jdk

This will install OpenJDK on your system which will be fine for running everything in this tutorial. This option will require you to trust some additional certificates during the installation of Eclipse later.

Oracle JDK If you would rather install the Oracle JDK from the website above do not execute the apt-get shortcut-command and follow these steps:

After downloading the tar.gz file from the website go to a terminal and execute the following commands (the commands are valid if you downloaded version jdk-8u171-linux-x64.tar.gz otherwise adjust the commands to reflect the correct version of Java):

cd /usr/
sudo mkdir java
cd java/
sudo mv ~/Downloads/jdk-8u171-linux-x64.tar.gz .
sudo tar zxf jdk-8u171-linux-x64.tar.gz

This will install Java to your system. To use it, you must execute the following commands:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk1.8.0_171/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk1.8.0_171/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/java/jdk1.8.0_171/bin/javaws" 1
sudo update-alternatives --set java /usr/java/jdk1.8.0_171/bin/java
sudo update-alternatives --set javac /usr/java/jdk1.8.0_171/bin/javac
sudo update-alternatives --set javaws /usr/java/jdk1.8.0_171/bin/javaws

You can test if the setup was successful by running javac -version and java -version and making sure the commands exist and display the correct version of Java.

Install Eclipse

Everything in this project will require Eclipse, a free IDE that supports GUI integration. Download Eclipse here: Eclipse Download. When the eclipse installer window pops up, make sure to pick "Eclipse IDE for Java Developers".

When launching Eclipse you must select a location for your new workspace before continuing. This folder will contain all projects and imports saved in the workspace. Once that's done, close the "Welcome" tab. Feel free to close the "Task List" and the "Outline" views as well to clear some space on your monitor.

Ubuntu 16.04/18.04 (OUTDATED)

To run the installer after the download execute the following commands:

 cd ~/Downloads
 tar -xf eclipse-inst-linux64.tar.gz
 cd eclipse-installer
 ./eclipse-inst

After the installation is finished and you have started Eclipse for the first time from the launcher you can right click the icon in the launcher and select Lock to Launcher to be able to easily start Eclipse again. If you skip this step you can run Eclipse from a terminal using ./eclipse/java-oxygen/eclipse/eclipse where you modify the path to the installation.

Setting up Git

In the top right corner, click on the "Open Perspective" button and select Git.

image

The layout will change to include several new views, one of which is "Git Repositories". We need to clone a repository to access our tutorial materials; get the clone link and copy it: https://github.com/ihmcrobotics/ihmc-open-robotics-software-tutorials.git In Eclipse, select "Clone a Git repository", a pop-up window should show up with the address to the repo already populated. Note, that you can leave the Authentication block blank since the repository is public.

image

In the third step of this process, make sure the repo is cloned at the desired location. The repo can be cloned inside the eclipse workspace directory. This is the directory you selected when starting up eclipse (e.g. /home/user/EclipseWorkspace/ihmcTutorials on Ubuntu or C:\EclipseWorkspace\ihmcTutorials on Windows).

image

Your Git Repositories view should look something (depending on your folder name and location) like this:

image

Specify Gradle version

This specification is necessary for smooth progression through this tutorial.

Every single step is required to build the tutorials!

Open the preferences dialog using the menus: Window > Preferences, then go to Gradle section and select the version 7.5.1 as shown below. Also, make sure to set the Java home folder correctly:

image

It is also a good idea to double check if the installed Java JRE is correctly selected:

image

Proceed to the next step of this tutorial import simulation construction set examples project.