IntelliJ IDEA can't setup JDK

64,505

Solution 1

File | Invalidate Caches is the first thing you should try in case of such issues.

Solution 2

Select your modul in the "Project View" and press F4 in the "Project Setting"select "Module". In the "Module Settings" overview you can add/remove the Modul SDK.

Solution 3

Following this worked for me :

Select your module in Project View

Press F4

Go to SDK

Select you SDK

Make sure you have various jars in there. Else, select proper directory.

In my case, even though correct directory was selected classpath,sourcepath etc were empty.

So I had to select jdk installation directory one more time, which loaded all the jars and solved the problem.

Solution 4

In my case just File | Invalidate Caches and Restart did not work. Upon Right clicking the project and going to Module Settings , I had no SDK selected under Project Settings->Project.

Solution 5

I followed below steps

  1. Press F4
  2. Select Modules in Project Settings
  3. Set up Module SDK from the drop down or add the new one.
  4. Apply & OK
Share:
64,505
mr.nothing
Author by

mr.nothing

Updated on July 09, 2022

Comments

  • mr.nothing
    mr.nothing almost 2 years

    I'm trying to setup JDK in IntelliJ IDEA and whatever I do, or whatever JDK version I select, nothing happens. The following situation remains: enter image description here

    So I told IDEA what JDK it should use, but it still asks me to setup a JDK. Is this a bug or am I missing something? Can I apply any workaround to make everything work as usual?

    ADDITION

    The steps which I go through setting up the JDK: situation before setting up:
    enter image description here

    the first step:
    enter image description here

    the second step:
    enter image description here

    the third step:
    enter image description here

    the situation after setting up JDK: enter image description here

    SDKs:
    enter image description here

    module settings:
    enter image description here

  • mr.nothing
    mr.nothing about 12 years
    I tried to delete all jdks and to setup it from scratch, but unfortunately no effect.(
  • Jared Scarito
    Jared Scarito over 5 years
    You're a life-saver... I thought I broke the IDE! Computer got knocked out by a power blink outage and then I load it back up to all the red errors. Thank you for this @CrazyCoder