Hi! Im upgrading my project from `Java 17` to `Jav...
# community-support
o
Hi! Im upgrading my project from
Java 17
to
Java 21
which requires a Gradle upgrade from
7.6.1
to
8.5
I executed
gradle help --scan
and checked the build scan and it showed no deprecation issues But right after upgrading Gradle to
8.5
Im getting this issue
Copy code
Plugin [id: 'com.netflix.dgs.codegen', version: '5.1.17'] was not found in any of the following sources
FYI I didn't make any other change to my project, just the Java and Gradle upgrade, if I get back to Gradle
7.6.1
build start working again Any help will be appreciated
c
if your goal is to compile your code with Java 21 you can accomplish that with Java toolchains, decoupling from the Java version that is running Gradle. For the Gradle upgrade - its generally a good idea to first upgrade plugins to the latest compatible version before upgrading Gradle; you may have already seen the Gradle upgrade docs.
o
Thanks for your quick response, I’ll try it tomorrow 👌
I reverted the gradle upgrade to have the version
7.6.1
, and I added this
Copy code
java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(21)
    }
}
But Im having this issue
Copy code
* What went wrong:
Could not open cp_settings generic class cache for settings file '.../settings.gradle' (/Users/obarrios/.gradle/caches/7.6.1/scripts/2mmg1xqy0ezdl7o38hg2c62ie).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65
And regarding the upgrade the plugin, the
Plugin not found
is also happening with the latest version
v
The error means you are running Gradle with Java 21, while that version of Gradle does not support running on that Java version.
o
Yeah I know I was just trying Chris's suggestion, and upgrading the Gradle version brings me back to my first issue 🥲
🤔 ok so I upgraded the plugin to it's latest version
6.1.10
and Gradle to the latest version
8.7
and error is gone, so I guess it was some versioning issue, it will be nice if the error could be improved though, thanks for your help guys