IntelliJ IDEA 2023.3.6: Project structure auto assgined sdk version

已回答

I've been trying to update IntelliJ IDEA to version 2023.3.6, but I've run into a problem. The build process takes over 45 minutes, and I've traced the issue back to the project structure settings. It seems that the modules keep reverting to using Java 11, even after I manually change them. I also tried to delete the java 11, but it will also auto download and added back. Every time I reload Gradle, they switch back to Java 11 automatically. At the end, it result in a mix of both java 12 and java 11, causing the build project to stuck. I'm at a loss for how to resolve this behavior, this doesn't happens in version 2022.3.3. Any insights would be greatly appreciated!
Is there any new setting or feature/plugins that can affect this 

0

Hello,

IDE uses build.gradle as an initial source of project configuration. So, if Java 11 is set there it will be set in Project Structure after build/refresh. Is it possible to share sample project example or at least build.gradle for investigation?

0

I check the build.gralde from the project, it doesn't have or specify java version in it. I'm pretty sure the usual way to set up our prject, I  just need to go to Project strucutre → set up sdk 12, language level : 11→ module will auto assigned with setup sdk. At least this is the expected behavior that I see from all previous Intellij version. Most of the people in our team is able to set this up without issue, but I'm not sure why it happens to me in all of the newer Intellij version start from 2023→2024.

0

Is it possible to provide sample project example for investigation?

You may share it via https://uploads.jetbrains.com/ form. Just provide upload ID afterwards.

0

I'm unable to provide a simplified example since the project is quite complex, making it difficult to replicate the exact behavior in a simpler example. Additionally, I seem to be the only one experiencing this issue, which further complicates the troubleshooting process. My suspicion is that the problem might be related to new settings or plugins introduced in the latest IntelliJ version. While I'm unable to share the project content, I can certainly provide details about the settings in IntelliJ that might be relevant to the issue.

0

Could you at least provide build.gradle file?

0

I've identified the root cause of the problem. It appears that the issue stems from a new feature introduced in IntelliJ IDEA 2023.1 - the automatic detection of the Java SDK from the Gradle toolchain (https://www.jetbrains.com/idea/whatsnew/2023-1/). In previous versions of IntelliJ, modules were typically configured with a default SDK from the project settings. However, with this new feature, there can be a mixture of SDKs if the SDK specified in the build.gradle file differs from the project SDK.

Is there a way to deactivate or disable this feature?

0

Do you have toolchain configured in your project? Why couldn't you change Java version in toolchain?

0

After checking with my team and did some additional settings, I was able to resolved this. I'll marked this as resolved.

0

请先登录再写评论。