No JDK specified for module ERROR MESSAGE
已回答
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!
请先登录再写评论。
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
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
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
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.
Great support, right on time....
Was stuck for so long because of this issue. Thank you for your help J. Ansorg
There is no "Project settings..." under "File" anymore, could you update this answer?
You can open File | Settings instead (Ctrl+Alt+S).
Restart intelliJ and import project as maven if it is a maven project.
To Add JDK to your Project
.
Go to File > Project Settings > Modules > Module SDK: (Drop Down to select the JDK of choice)
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.
This fixed the issue for me.
>> Restart the IDE and Reload the Maven Project
Hi. Are you still alive ? :) ❤️
Hi,
As far as I have seen, the menu structure has changed. For version 2021.2.3, the path is File > Project Structure > Project > Project SDK
This fixed the issue for me too.
>> Restart the IDE and Reload the Maven Project
Fixed the problem for me. Thank you so much. Your way of telling the answer stood out among all. Everyone should learn from you.