Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the IntelliJ IDEA default JDK?

People also ask

Is IntelliJ IDEA a JDK?

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..."

Selecting Structure For New Projects

Next, modify the "Project SDK" and "Project Language Level" as appropriate.

Selecting Project Language Level


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 )

jdk 9 intellij 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.


  • I am using IntelliJ IDEA 14.0.3, and I also have same question. Choose menu File \ Other Settings \ Default Project Structure...

enter image description here

  • Choose Project tab, section Project language level, choose level from dropdown list, this setting is default for all new project.

    enter image description here

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)

enter image description here

enter image description here


Change JDK version to 1.8

  1. Language level File -> project Structure -> Modules -> Sources -> Language level -> 8-Lambdas, type annotations etc. enter image description here
  2. Project SDk File -> project Structure -> Project 1.8 enter image description here

  3. Java compiler File -> Settings -> Build, Executions, Deployment -> Compiler -> Java compiler enter image description here