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.
## Option 1: Different JDK
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.
## Option 2: Rebuild JDK Table
1. Shut down the IDE
2. Find and delete `jdk.table.xml` from your app's config directory (somewhere in `~/Library/Application Support/` or `%APPDATA%`)
3. Start up the IDE and let it finish indexing.
4. Return to Gradle preferences and specify your preferred JDK