-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDK 8 not being auto-selected as Project-Level SDK on Jetbrains IDE #15114
Comments
When we resolve the issue, we should also update docs on how to override / set the default version for a project. Including things like order of precedence and how to test whether your changes have applied to the workspace. https://www.gitpod.io/docs/introduction/languages/java#updating-java-maven--gradle |
@fcamblor IntelliJ detects JDK version form maven or gradle configuration and try to find the compatible one, i.e. if pom.xml has java 11 set then even if default JDK is 8, IntelliJ will pick the highest closest (i.e. compatible). Could you check what your project has specified in source/target level in pom.xml or gradle.build? |
Hello @akosyakov, I'm not using maven nor gradle in my case, this is a Scala project which relies on sbt. |
We reverted the custom JDK detection logic to use one from IntelliJ itself, but it behaves the same way. Here is an issue in the upstream: https://youtrack.jetbrains.com/issue/GTW-2758/IntelliJ-selects-Java-17-when-pom.xml-targets-Java-11-without-.idea-folder |
@fcamblor our I would recommend removing the versions you don't need and by doing that, IntelliJ will pick up the right JDK.
Note: I've pinned the image to the most recent tag |
@fcamblor, did you have a chance to try the solution mentioned above by Andrea? |
Sorry, it got out of my radar. I've just launched a re-build of my particular Scala workspace to check it. |
Forget, this is my bad, I just discovered that during my test above, I had a I updated the file (removed uninstalled JDK references, keeping only my JDK 8 in it) and this time, it worked fine ! :-) Thanks everyone for the help, much appreciated ! |
Bug description
As discussed on Discord I'm encountering problem while trying to pre-select something different than te default Project-Level SDK (
JDK 11
on Intellij 2022.2.4)Got help from @felladrin who suggested to create this issue, telling that the problem may be located around here
Steps to reproduce
You can start a gitpod instance with JDK pre-installed :
But Project-level JDK remains with pre-bundled JDK 11 :
Workspace affected
No response
Expected behavior
I would expect that Project-Level JDK should be set to globally-configured JDK (in case above, JDK 8)
Example repository
Anything else?
It could be related to a Jetbrains issue here regarding JDK Detector.
The text was updated successfully, but these errors were encountered: