File - Project Structure
Platform Settings - SDKs - JDK home path
Project Settings - Project - SDK - Add JDK (フォルダを選択)
Gradleの場合
Failed to calculate the value of task ':compileJava' property 'javaCompiler'.
Cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=21, vendor=any vendor, implementation=vendor-specific} for WINDOWS on x86_64.
No locally installed toolchains match and toolchain download repositories have not been configured.
File - Settings
Build, Execution, Deployment - Build Tools - Gradle - Gradle JVM