IntelliJ IDEA doesn't come with the JDK, so if you don't have the necessary JDK version, download and install it.
This setting is changed in the "Structure for New Projects" dialog. Navigate to "File" -> "New Projects Settings" -> "Structure for New Projects..."
Next, modify the "Project SDK" and "Project Language Level" as appropriate.
Previous versions of IntelliJ IDEA had this setting in "File" -> "Other Settings" -> "Default Project Structure...".
IntelliJ IDEA 12 had this setting in "Template Project Structure..." instead of "Default Project Structure..."
Download and unpack a JDK archive file (.tar.gz) and add it as a SDK in the 'Project Structure' dialog box ( Ctrl+Alt+Shift+S )
click on the gif to enlarge
Make sure to set an appropriate 'Project language level' as well.
For Java 8 set it to 8, for Java 9 set it to 9, and so on.
File
\ Other Settings
\ Default Project Structure...
Project
tab, section Project language level
, choose level from dropdown list, this setting is default for all new project
.I have found out that in recent versions of IntelliJ IDEA requires Java 1.8 but is not configured by default.
We can change the path or configure from Project Settings
> Project
> Project SDK
here we can edit or add the JDK´s path.
(in my case the path is located in C:\Program Files\Java\jdk1.8.0_102
)
Change JDK version to 1.8
Project SDk File -> project Structure -> Project 1.8
Java compiler File -> Settings -> Build, Executions, Deployment -> Compiler -> Java compiler
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With