Setup

To be able to develop programs in Java through Intellij, a few different programs are needed.

Download and Install Intellij

  1. Navigate to https://www.jetbrains.com/idea/download/ or google “install intellij” without quotes.

  2. Select your operating system.

    ../_images/choose-os.png
  3. Click the black download button below Community as we will not be using the paid Ultimate version

    ../_images/choose-community.png
  4. After clicking the download button, a popup will appear asking where you would like to download the installer to on your computer.

  5. Select the desktop and click Save.

    ../_images/download-location.png
  6. Once downloaded, double click the installer, which looks like this.

    ../_images/installer-icon.png
  7. After double clicking the icon you may be prompted to allow the Intellij Installer to make changes to your device. Clicking Yes is necessary for the installer to install the appropriate files to your computer’s hard drive.

    ../_images/user-account-control.png
  8. Click the next button to begin.

    ../_images/installer1.png
  9. Select a personalized download location, or simply click next to accept the default location.

    ../_images/installer-installpath.png
  10. Create a desktop shortcut or any file type associations, or simply click next to accept the default values.

    ../_images/installer-shortcutsandassociations.png
  11. Specific start menu folder, or accept the default value of “JetBrains” and click next.

    ../_images/installer-startmenufolder.png
  12. After clicking the install button IntelliJ will begin installing using the options you selected previously. You should see a screen that looks like this.

    ../_images/installer-installbar.png
  13. Click the checkbox beside Run IntelliJ IDEA Community Edition.

  14. Now click Finish.

    ../_images/installer-finish.png

You Are Done!


Download and Install JDK

To actually develop Java, we require the Java Development Kit or JDK for short. This is a package that contains the tools needed to compile, debug, and test code written for Java. We will need to download the kit from Oracle.

  1. Navigate to http://www.oracle.com/technetwork/java/javase/downloads/index.html to find the latest Java related downloads.

  2. Click the Java Platform (JDK) link.

    ../_images/2.png
  3. To download the JDK you must accept Oracle’s Binary Code License Agreement for Java SE. If you decide not to accept the license agreement, you cannot download the JDK and will not be able to develop Java.

    ../_images/3.png
  4. Select the download for your specific operating system. You should only download one file. If you do not know what version of Windows you are running, jump to Setup - Downloading the JDK.

    ../_images/4.png
  5. After clicking the download button, a popup will appear asking where you would like to download the installer to on your computer.

  6. Select the desktop and click Save.

    ../_images/6.png
  7. Once downloaded, double click the installer, which looks like this.

    ../_images/7.png
  8. After double clicking the icon you may be prompted to allow the JDK Installer to make changes to your device. Clicking Yes is necessary for the installer to install the appropriate files to your computer’s hard drive.

  9. Once the installer has launched, click next and follow the instructions displayed in the installer.

    ../_images/8.png
  10. Once the install has finished, we need to setup the Environment Variables for the JDK, specicially: JAVA_HOME. To do so, first locate the install path of the JDK. If use did not change the install path in the JDK Installer and it used the default location then you can find it at C:/Program Files/Java/. Within this folder, you will find a folder called jdk1.8.0_XXX where XXX is the specific build. The latest version available at the time of this writing was 1.8.0_121, so our path is: C:/Program Files/Java/jdk1.8.0_121 as shown below.

    ../_images/9.png
  11. After you have determined the path to your JDK install, we need to actually set the Environment Variable. This can be done by opening the Start Menu and typing environment variables and selecting `Edit the system environment variables. This will cause a window to pop open.

    ../_images/10.png
  12. Click the Environment Variables button at the bottom of the window to open the Environment Variable settings.

    ../_images/11.png
  13. In the second section titled System Variables, click the New button to add a new environment variable.

    ../_images/12.png
  14. In the box that pops open, you need to provide both the Variable name and Variable value. Insert JAVA_HOME`as the `Variable name and insert the path to your JDK directory as the Variable value. Ours was C:/Program Files/Java/jdk1.8.0_121/, however yours may be different. We found this value in step 10!

    ../_images/13.png
  15. After inserting the values, click the Okay to finalize your input for the new environment variable.

  16. If you check, you should now see the JAVA_HOME entry in the System Variables. Click the Okay button to save the changes to your environment variables and close the window.

    ../_images/15.png

That’s it, you’ve completely setup the JDK! Now with both Intellij and the Java Developer Kit setup you are ready to proceed to Setting up a Java Project in Intellij!