IntelliJ IDEA can't setup JDK

JavaIntellij IdeaSettings

Java Problem Overview


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

Java Solutions


Solution 1 - Java

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

Solution 2 - Java

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 - Java

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 - Java

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 - Java

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

Solution 6 - Java

For someone like me, looking for a way to setup an offline documentation in IDEA on UBUNTU Linux. You should install the openjdk-8-doc (or openjdk-X-doc in general case) package, then go to File|Project Structure|SDKs|1.8(still 1.X in general), then select tab Documentation Paths and add the path /usr/lib/jvm/java-1.8.0-openjdk-amd64/docs/api there.

Note, that path of Java docs installation may differ on your machine. You are able to check the path of Java docs installation executing dpkg-query -L openjdk-8-doc | less in a shell.

Solution 7 - Java

I was seeing this exception in the console:

NoClassDefFoundError: com/intellij/remote/RemoteSdkConnectionAcceptor

which was caused by the python community edition plugin on Intellij IDEA 2016.2.5.

After updateing/disableing the plugin, I was able to setup the SDK again.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionmr.nothingView Question on Stackoverflow
Solution 1 - JavaCrazyCoderView Answer on Stackoverflow
Solution 2 - JavaAlexView Answer on Stackoverflow
Solution 3 - JavaHarshitView Answer on Stackoverflow
Solution 4 - JavanileshView Answer on Stackoverflow
Solution 5 - JavaBadrinathView Answer on Stackoverflow
Solution 6 - JavaVladimir NazarenkoView Answer on Stackoverflow
Solution 7 - JavaGameScriptingView Answer on Stackoverflow