Reputation: 4191
Why is my build.gradle.kts file looking like this? This is a fresh Spring Boot project generated with start.spring.io. I already tried invalidate caches / restart, rebuild, resyncing and nothing works. Thanks in advance!
Upvotes: 15
Views: 8669
Reputation: 366
The IDE's JDK registrations are most likely inaccurate or outdated. In my case this was in Android Studio and tied to a Toolbox issue. Whatever your case, the principle is the same.
Search for the "Gradle" page settings in Preferences, pick or download a different compatible JDK from the list, then run Gradle sync.
If that works, you know the problem. If you can just stick with the new one, great. If you need to fix the previous JDK (e.g. you're in Android Studio and want the embedded one), you will want to rebuild the JDK table.
jdk.table.xml
from your app's config directory (somewhere in ~/Library/Application Support/
or %APPDATA%
)Upvotes: 10
Reputation: 1805
I always had this issue in Android studio, but there is an easy way to solve it:
replace default "Embedded JDK" with a path to the separately downloaded JDK
For example in Android studio: Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JDK
After that, Reload Gradle Project
.
Upvotes: 0
Reputation: 4191
This is what solved it:
Upvotes: 7