IntelliJ Idea - Install JDK 1.8 on Mac

12,403

Solution 1

Here you can download the Java JDK 1.8. After installing it, it should appear as an option inside IntelliJ.

UPDATE:

Find File -> Project structure menu and go to Project Settings -> Project tab. If on Project SDK the Java version 1.8 SDK is not selected, change it and click OK.

Solution 2

In 2022, you can use just brew

brew install openjdk@8

and then add into Intellij IDEA as new SDK with the following path:

/usr/local/opt/openjdk@8

maybe you need to update PATH env:

export PATH="/usr/local/opt/openjdk@8/bin:$PATH"

…and for the future give a try to sdkman, is better than brew

curl -s "https://get.sdkman.io" | bash

then open a new shell and try list to see what you could install ;-)

sdk list java 

At time of writing you could use:

sdk install java 8.0.312-tem
Share:
12,403
user2B4L2
Author by

user2B4L2

Updated on August 23, 2022

Comments

  • user2B4L2
    user2B4L2 over 1 year

    I use IntelliJ IDEA Ultimate 2017.3.3 and need to use Scala Version 2.12 for a project. However, IntelliJ says that JDK 1.8 is required for Scala Version 2.12. My problem is that I cannot select/choose JDK 1.8. Hence How can I set/install JDK to 1.8?

    Any help is heavily appreciated.

    Error Message

    enter image description here

  • user2B4L2
    user2B4L2 over 6 years
    Thank you very much for your quick response. I followed your suggestions: and installed "jdk-8u161-macosx-x64.dmg". However, I still do only have the option 1.6 above but not 1.8. So nothing changed. What else can I do?
  • nicodp
    nicodp over 6 years
    Have you restarted IntelliJ?
  • user2B4L2
    user2B4L2 over 6 years
    Yes, I did again restart both IntelliJ and the whole System (Laptop).
  • user2B4L2
    user2B4L2 over 6 years
    Thanks again, yes that seems to somewhat yield to the correct menu but I still cannot choose JDK 1.8; I can only select 1.6. : ( However, I can either click on "New ..." or "Edit". Can you guide me through the process of how to add a New JDK?
  • nicodp
    nicodp over 6 years
    You should select New, and find the path of the new version of your Java 1.8 JDK, which should be close to the path of the current one.
  • user2B4L2
    user2B4L2 over 6 years
    SOLVED! If I clicked on "New..." I just had to select "JDK", the window popped up where I was in folder "1.6.0.jdk" by default. Now, all I had to do was to change to the new folder "jdk1.8.0_161.jdk" folder, which is stored in the same folder as "1.6.0.jdk", namely in the "JavaVirtualMachines" folder.
  • Basil Bourque
    Basil Bourque over 2 years
    FYI, Oracle is but one of several vendors providing installers or binaries for a Java 8 JDK. Other vendors include, off the top of my head: SAP, Pivotal, Microsoft, Adoptium (formerly AdoptOpenJDK), Azul Systems, BellSoft, Amazon, Red Hat/IBM, and possibly others.