Fully hand-held tutorial on setting up the Java environment to a usable state as quickly as possible. Only knowledge of using the terminal is expected. This tutorial will be completely self-contained (excluding links to downloads).
This guide contains some links to some internal pages; these links are not necessary for setting up the environment and only exist as additional assistance for IHMC personnel and others with access.
Note | ||||
---|---|---|---|---|
| ||||
For more detailed tutorials, see General Development Environment Setup Guide |
The general steps are:
- Install Java
- Install Gradle
- Import Repositories
- Install and configure IDE
Panel | ||||
---|---|---|---|---|
|
...
Ubuntu
(in progress)
Java
...
Curl
...
Curl is a package manager that we will use to install some software. To install it, open a terminal and run:
Code Block |
---|
$ sudo apt install openjdk-17-jdk openjdk-17-doc openjdk-17-sourcecurl |
Verify installation by running
Code Block |
---|
$ curl --version |
Java
...
Open a terminal.
Multiexcerpt include | ||||
---|---|---|---|---|
|
Gradle
...
We are currently on Gradle 7. We will install it manually for ease of understanding. The official guide is here for reference. (Aside: we do not use the Gradle Wrapper)
- Download the latest Gradle 7 distribution (7.4.2 as of writing).
- Choose the "complete" version.
- Remember where you downloaded it.
Unpack Gradle (the following are excerpted from the gradle website)
cd into the directory where you downloaded Gradle. Then
Excerpt - Unzip the distribution zip file in the directory of your choosing, e.g.:
Code Block $ mkdir /opt/gradle $ unzip -d /opt/gradle gradle-7.4.2-all.zip
Add to path
Excerpt - In File Explorer right-click on the
This PC
(orComputer
) icon, then clickProperties
->Advanced System Settings
->Environmental Variables
. - Under
System Variables
selectPath
, then clickEdit
. Add an entry forC:\Gradle\gradle-7.4.2\bin
. Click OK to save.
- In File Explorer right-click on the
Verify installation
Excerpt - Open a console (or a Windows command prompt) and run
gradle -v
to run gradle and display the version, e.g.:
Code Block $ gradle -v ------------------------------------------------------------ Gradle 7.4.2 ------------------------------------------------------------
- Open a console (or a Windows command prompt) and run
- Configure for IHMC software
- excerpt from Gradle#Installation
- create gradle.properties file in C:/Users/user/.gradle/gradle.properties
- Copy/paste
Code Block org.gradle.java.home=C:/Program Files/Java/jdk-17.0.3.1 org.gradle.jvmargs=-Xmx4g
...
Open a terminal and run the following:
Multiexcerpt include | ||||
---|---|---|---|---|
|
Multiexcerpt include | ||||
---|---|---|---|---|
|
Configure for IHMC software
Multiexcerpt include | ||||
---|---|---|---|---|
|
- Copy paste the following lines into the file
Multiexcerpt include MultiExcerptName gradle.properties ubuntu example ihmc employee PageWithExcerpt Gradle Multiexcerpt include MultiExcerptName gradle.properties ubuntu example PageWithExcerpt Gradle
Import Repositories
...
Quick:
Multiexcerpt include | ||||
---|---|---|---|---|
|
More details:
Multiexcerpt include | ||||
---|---|---|---|---|
|
IDE
...
This guide currently only contains instructions for IntelliJ. We are working on Eclipse.
Eclipse
Note | ||||
---|---|---|---|---|
| ||||
Full guide: Eclipse IDE |
Intellij
Note | ||||
---|---|---|---|---|
| ||||
Full guide: IntelliJ IDEA |
- Download IntelliJ Community.
- https://www.jetbrains.com/idea/download/#section=linux
- Open a terminal and cd into the folder where you downloaded the tar file
Extract the file and move it to /opt/. (If you already downloaded from the link above, there is no need to run curl). Replace the names appropriately based on the version you download.
Multiexcerpt include MultiExcerptName Ubuntu Get IntelliJ PageWithExcerpt IntelliJ IDEA Multiexcerpt include MultiExcerptName Run Intellij PageWithExcerpt IntelliJ IDEA Multiexcerpt include MultiExcerptName IntellijDesktopLauncher PageWithExcerpt IntelliJ IDEA
- Now you will need to configure IntelliJ to the Java environment you installed.
Multiexcerpt include MultiExcerptName IntellijConfiguration Quickstart PageWithExcerpt IntelliJ IDEA Multiexcerpt include MultiExcerptName Intellij quickstart successful PageWithExcerpt IntelliJ IDEA
Note | ||||
---|---|---|---|---|
| ||||
Network Parameters |
...
This step is necessary if you are working on high-level behaviors, but not necessary to run the simulations.
Multiexcerpt include | ||||
---|---|---|---|---|
|
...
Windows
...
Git
- Install Git. Use the 64-bit standalone installer
...
Hereby, "open a terminal/console" will refer to launching git bash.
Java
...
We use Java 17.
- Go to the Oracle download page and download the MSI installer:
This will download Java to the folder (or as appropriate for the version)
Code Block |
---|
C:\Program Files\Java\jdk-17.0.3.1 |
- (Aside: The java path variable is already set using oracle. No action is needed)
- Double-check that java is installed properly:
Open a terminal and type in:
Code Block |
---|
java -version |
Something like the following should be outputted:
Code Block |
---|
java version "17.0.3.1" 2022-04-22 LTS
Java(TM) SE Runtime Environment (build 17.0.3.1+2-LTS-6)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.3.1+2-LTS-6, mixed mode, sharing)
|
Gradle
We are currently on Gradle 7
Multiexcerpt include | ||||
---|---|---|---|---|
|
Gradle
...
We use Gradle. We will install it manually for ease of understanding. The official guide is here for reference. (Aside: we do not use the Gradle Wrapper)
...
- Download the latest Gradle 7 distribution (7.4.2 as of writing).
- Choose the complete version.
- Remember where you downloaded it.
Unpack Gradle (the following are excerpted from the gradle website)
Excerpt - Create a new directory
C:\Gradle
with File Explorer. - Open a second File Explorer window and go to the directory where the Gradle distribution was downloaded. Double-click the ZIP archive to expose the content. Drag the content folder
gradle-7X.4X.2
X
to your newly createdC:\Gradle
folder.
- Create a new directory
Add to path
Excerpt - In File Explorer right-click on the
This PC
(orComputer
) icon, then clickProperties
->Advanced System Settings
->Environmental Variables
. - Under
System Variables
selectPath
, then clickEdit
. Add an entry forC:\Gradle\gradle-7X.4X.2X\bin
. Click OK to save.
Verify installation
Excerpt Open a console (or a Windows command prompt) and run
gradle -v
to run gradle and display the version, e.g.:- In File Explorer right-click on the
$ gradle -v ------------------------------------------------------------ Gradle 7.4.2 ------------------------------------------------------------Code Block Multiexcerpt include MultiExcerptName gradle verify PageWithExcerpt Gradle - Configure for IHMC software
- excerpt from Gradle#Installation create
- Copy/paste
Code Block org.gradle.java.home=C:/Program Files/Java/jdk-17.0.3.1 org.gradle.jvmargs=-Xmx4g
Multiexcerpt include | ||
---|---|---|
|
Import Repositories
Don't forget the long paths thing
IDE
Choose your favorite IDE. I like intellij because it was the first IDE I arbitrarily chose to use.
Eclipse
home location PageWithExcerpt Gradle - Copy paste the following lines into the file
Multiexcerpt include MultiExcerptName gradle.properties windows example ihmc employee PageWithExcerpt Gradle Multiexcerpt include MultiExcerptName gradle.properties windows example PageWithExcerpt Gradle
Import Repositories
...
Quick:
Multiexcerpt | ||
---|---|---|
| ||
We will be cloning repositories from the command line. Open a terminal and cd to a directory where you want to hold your files. The directory is arbitrary, but you will need to remember it. First, consider a name for your repository group. "repos" works if you only need one workspace. That name will referred to as <repo-name> below. Run the following: Your folder structure should now match what is shown in the next section. |
More Details:
Multiexcerpt include | ||||
---|---|---|---|---|
|
Long Paths
...
Long paths needs to be configured on Windows for our repositories.
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
IDE
...
This guide currently only contains instructions for IntelliJ. We are working on Eclipse.
Eclipse
Note | ||||
---|---|---|---|---|
| ||||
Full guide: Eclipse IDE |
Intellij
...
Note | ||||
---|---|---|---|---|
| ||||
Full guide: IntelliJ IDEA |
- Download IntelliJ Community. Choose the .exe for convenience
- https://www.jetbrains.com/idea/download/#section=windows
- All default installation options are fine.
- Now you will need to configure IntelliJ to the Java environment you installed.
- Your environment should be ready at this point. Import repository-group.
- File > Open > select repository-group
- Your projects bar should look like this:
depending on the repositories you imported. All software should now be runnable.
Usage:
- Upon each launch, IntelliJ will index your files for faster searching. You will need to wait for it to finish before navigating code.
Multiexcerpt include MultiExcerptName IntellijConfiguration Quickstart PageWithExcerpt IntelliJ IDEA Multiexcerpt include MultiExcerptName Intellij quickstart successful PageWithExcerpt IntelliJ IDEA
Note | ||||
---|---|---|---|---|
| ||||
Network Parameters |
...
This step is necessary if you are working on high-level behaviors, but not necessary to run the simulations.
Multiexcerpt include | ||||
---|---|---|---|---|
|