No JDK specified for module ERROR MESSAGE

Answered

Im new with using intellij and I installed it and I'm trying to run a java project but when I select run I get the following error: Error running build DBViews: No jdk for module "insert name". And idea on how to fix this? I have jdk installed. I've looked through the support documents to find an answer but the steps that they tell me to do aren't available for ex. I cannot create a "new" jdk. Thanks!

11 comments
Comment actions Permalink

Hi,
you need to set the JDK for your project and/or modules.

Open the project settings (File->Project settings...).

Most of the time you just need to set the project sdk (to your java sdk) and configure the modules to use the project sdk.
Probably one of those settings is missing.

Regards,
Wallaby

1
Comment actions Permalink

Still don't have that option. I heard something about pointing it to the jdk? how would u do that??



Attachment(s):
no jdk.jpg
0
Comment actions Permalink

Hello,

Take a look at my post in the following thread where I laid out detailed steps on how to confgure the JDK in a project. See if that helps. Seeing all the red gutter marks in your screenshot leads me to beleive you your JDK is not configured correctly.

http://devnet.jetbrains.net/message/5261815#5261815

-Mark

0
Comment actions Permalink

Sadly, Mark Vedder's link has broken (404).

On my machine, I found out where the JDK was by typing `which java` at the console.

0
Comment actions Permalink

Great support, right on time....

0
Comment actions Permalink

Was stuck for so long because of this issue. Thank you for your help J. Ansorg

0
Comment actions Permalink

There is no "Project settings..." under "File" anymore, could you update this answer?

0
Comment actions Permalink

You can open File | Settings instead (Ctrl+Alt+S).

0
Comment actions Permalink

Restart intelliJ and import project as maven if it is a maven project.

2
Comment actions Permalink


To Add JDK to your Project
.
Go to File > Project Settings > Modules > Module SDK: (Drop Down to select the JDK of choice)


0
Comment actions Permalink

Sai Amit Ahuja's suggestion worked for me. I had JDK set in Project Settings, but because I hadn't imported as Maven project the Run Configuration was still listing this error.

 

Edit: Just kidding. When I clicked on it the run config drop down the error icon reappeared. This solved it for me: Preferences > Build, Execution, Deployment > Build Tools > Maven. Make sure that "JDK for importer" is set to the same JDK you're using in Run Configuration's "JRE" selection.

0

Please sign in to leave a comment.