Videos
I'm prepping a Java programming course that requires IntelliJ Community Edition and where most students will likely have Windows pcs.
I don't typically use Windows & have a question about setup.
Do Windows users need to explicitly install the Java JDK after installing IntelliJ?
If so, is there any preference on variant (Oracle or OpenJDK) and version for working with latest IntelliJ?
tl;dr
/Users/your_username_here/Library/Java/JavaVirtualMachines/
Choose File > Project Structure > Platform Settings > SDKs
You can inspect the JDKs known to IntelliJ by choosing File > Project Structure > Platform Settings > SDKs.
Notice how the location of the selected JDK is shown in the JDK home path field.
In this example, the JDK downloaded by IntelliJ was put in:
/Users/your_username_here/Library/Java/JavaVirtualMachines/
Note that this location contrasts with the location used by some of the independent JDK installers. In my experience, those tools use the root /Library path, rather than in the user’s ~/Library. That full path would be: /Library/Java/JavaVirtualMachines.
SDKMAN!
By the way, an alternative tool I prefer for finding, downloading, installing, and uninstalling JDKs (and other software kits like Gradle) is SDKMAN!. It is a command-line tool for Unix-like operating systems including macOS.
It's changing form version to version, but can be easily inspected via:
File > Project Structure > Platform Settings | SDKs
now it's in .jdks subfolder in 2023 :)
This setting is changed in the "Structure for New Projects" dialog. Navigate to "File" -> "New Projects Setup" -> "Structure..."
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
Also make sure to set an appropriate 'Project language level'. I forgot to do that when creating the GIF.
Project Structure > Project > Project language level
For Java 8 set it to 8, for Java 9 set it to 9, and so on.