-
Notifications
You must be signed in to change notification settings - Fork 305
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
Multiple JAVA_HOME detected and wrong one selected #1855
Comments
Is your repository using codeql? If so, can you include your full (redacted) workflow file? If it isn't using codeql, then this is not the correct repo to raise the issue. |
I just learned that we have recently made some changes to CodeQL's ability to discover which versions of Java are installed in the build environment. Please see the details in this issue and it may help with what you are seeing. |
Hi @onacit! The issue that @aeisenberg linked to is likely what you are running into, but we have made some further improvements to the version selection logic since. I note that you are currently using CodeQL 2.14.1. CodeQL 2.14.3 contains the improvements, so if you can give that version a go and report back whether that works for you, that would be great! |
I think this is still happening: https://github.com/maevsi/android/actions/runs/6648225427/job/18064934351#step:4:78 |
This continues to be an issue. I just turned on the recommended default security configuration for the ankidroid organization, and in our Anki-Android project we get this non-sensical output where the gradle compatibility graph is not represented correctly in the codeql jdk selection logic:
Gradle 8.7 supports up to JDK21, not 11 as the newest. So I would expect JDK21, which would then work with autobuild https://docs.gradle.org/current/userguide/compatibility.html#java Is there some plan on fixing this ever? Otherwise I have to switch from the super-simple no-maintenance default configuration to the advanced build which means I have another github workflow yaml file to maintain, which is an anti-goal |
Hi @mikehardy, Sorry this isn't working right for you and agreed the output is a bit nonsensical here. The version selection logic contains hard-coded information about which Java version is required for a given Gradle version. This hasn't been updated since before Gradle 8.7 came out and therefore doesn't know what to recommend for it, leading the existing heuristics to a conservative and incorrect result. One of my colleagues is actively working on improving this at the moment, so everyone affected by this should see improvements once those improvements have shipped. They probably won't land in the next CodeQL release that's targeted for next week, but it shouldn't be far out. |
@mbg I see a pre-release for 2.17.3 (the version after the one you mentioned was too soon to get a fix) but I don't see anything in there, just curious if this is still under dev or not. Thanks! |
We just merged the changes late yesterday, so we missed the 2.17.3 release for this by a few days. I'll need to check if they'll make their way into the next release after this and will get back to you with which version I'd expect it to land in. |
Oh that's great. I was still trying to decide whether to expand the yaml in our repo for a manual build or to wait, sounds like it's well worth it to wait a bit more so autobuild just works, and I do love deferring/avoiding work when possible ;-). Thanks for the response |
I set up JDK 17 like this.
And it seems that autobuild selects wrong JDK.
And this is my enforcer rules evaluates.
The text was updated successfully, but these errors were encountered: