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).
...
Code Block |
---|
sudo apt install openjdk-17-jdk openjdk-17-doc openjdk-17-source |
Verify installation by opening a terminal and typing
Code Block |
---|
java -version |
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)
Open a terminal
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 $ sudo mkdir /opt/gradle $ sudo unzip -d /opt/gradle gradle-7.4.2-all.zip
Add to path
Code Block $ echo 'export PATH=$PATH:/opt/gradle/gradle-7.4.2/bin' >> ~/.bashrc
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
- Create a gradle.properties file in your user Home directory, ~/.gradle/gradle.properties
Copy/paste below into the file
Code Block org.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64 org.gradle.jvmargs=-Xmx4g
...
- 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
Windows
...
Git
- Install Git. Use the 64-bit standalone installer
...
- 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-7.4.2
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-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 ------------------------------------------------------------
- Configure for IHMC software
- excerpt from Gradle#Installation
- create gradle.properties file in C:/Users/<user>/.gradle/gradle.properties
- Copy/paste
Multiexcerpt include MultiExcerptName gradle.properties home location PageWithExcerpt Gradle - Copy paste the following lines into the file
Multiexcerpt include MultiExcerptName gradle.properties windows example PageWithExcerpt Gradle
Import Repositories
Don't forget the long paths thing
...
- 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.
Multiexcerpt include MultiExcerptName IntellijConfiguration Quickstart PageWithExcerpt IntelliJ IDEA Multiexcerpt include MultiExcerptName Intellij quickstart successful PageWithExcerpt IntelliJ IDEA
Usage:
- Upon each launch, IntelliJ will index your files for faster searching. You will need to wait for it to finish before navigating code.