IntelliJ keeps losing my JDK.
I'm building a minecraft mod in IntelliJ because that's what the tutorial series I was following at the start was using, and it's fine until it suddenly isn't. I had my mod functional, launching minecraft, doing everything it needs to do at this stage of development plus or minus some bugs. When I went to sleep, it was working.
I wake up, relaunch IntelliJ, and now the client won't run because it can't find the JDK for my mod's main package.

This is like the twelveth time it's happened, and copying the /src over to a new projects fixes the issue until it breaks again.
How do I fix this without spinning up a new project and copying the old /src to the new project everytime it happens? I've tried everything I can think off and anything I could find on the internet, and nothing has worked and it's getting frustrating.
请先登录再写评论。
Is it a Maven project or something else?
I am using the community version. The exe I downloaded to install it was: ideaIC-2023.3.6.exe.
I'm not a tech person so I don't really know the answer to your other question. I think the answer is it's a gradle project, but I'm not sure. I just downloaded a project template while following a tutorial. The github repo can be found here if you want to confirm I've got the answer to that question correct.
I'm on a windows 11 system, and the nature of minecraft modding is, according to the tutorial, based in JDK 17.
It is a Gradle project, to address the issue please try the following:
Let me know if it helps with the issue. If not, please collect the logs via the menu Help > Collect logs and Diagnostic Data , upload it to https://uploads.jetbrains.com/ , then paste the upload id here.
I un/reinstalled intellij which seems to have fixed the problem, for now ( project I was working on yesterday is still launching today; and I love-hate when reinstalling the misbehaving thing fixes it, 'cause on left-hand, problem solved (for now) but on right-foot, I don't learn anything about what caused the error in the first place nor how to fix it with less belligerent methods if/when it goes pearshapped again.
Thanks so much for your paitence and willingness to help. If/when it starts acting up again, I'll be back to see if we can figure it out what poltergiest crawled into my ram and died. But for now at least, it seems like I'm good to go.