You need to configure the Project Structure settings within the IDE.
First, ensure IntelliJ IDEA recognizes the newly installed JDK:
Open IntelliJ IDEA.
Go to File > Project Structure (or press Ctrl+Alt+Shift+S on Windows/Linux).
In the Project Structure dialog, under Platform Settings, select SDKs.
Click the plus (+) icon and select Add JDK from disk....
Navigate to the installation directory of your JDK 25 (e.g., C:\Program Files\Java\jdk-25) and click OK.
IntelliJ IDEA will add the JDK to its list of available SDKs. Click Apply and then OK.
Next, you need to specify that your current project should use this JDK:
Open the Project Structure dialog again (File > Project Structure or Ctrl+Alt+Shift+S).
Under Project Settings, select Project.
In the Project SDK dropdown menu, select JDK 25 from the list of defined SDKs.
In the Project language level dropdown, it is recommended to select "SDK default" (or explicitly select a specific language level like "25 - Compact source files, module imports").
Click Apply and then OK to save the project settings.
If your project has multiple modules or you want specific modules to use different language levels:
In the Project Structure dialog, go to Modules.
Select the specific module(s) and go to the Dependencies tab.
Ensure the Module SDK is set to "Project SDK" (which is now JDK 25) or specifically select JDK 25 from the list.
Check the Sources tab to confirm the language level is correct. It typically defaults to the project's language level setting.
Click Apply and OK.
If you are using Maven or Gradle, these tools can override the project settings.
For Gradle: Go to File > Settings > Build, Execution, Deployment > Build Tools > Gradle and ensure the Gradle JVM is set to Project SDK or JDK 25.
For Maven: Go to File > Settings > Build, Execution, Deployment > Build Tools > Maven > Importing and set the JDK for importer. Also, check the pom.xml file for any