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.
I don't know for sure the rational of the Intellij for (no longer?) including a link to a "vanilla" OpenJDK 17 download site. However my guess is that it is related to this notice on the https://jdk.java.net/17/ release page:
JDK 17 Releases
JDK 17 has been superseded. Please visit jdk.java.net for the current version.
Older releases, which do not include the most up to date security vulnerability fixes and are no longer recommended for use in production, remain available in the OpenJDK Archive.
Note that the OpenJDK team are no longer publishing new builds for OpenJDK 17. If you want the current Java 17 LTS build, you get it as an Oracle release or you get it from a 3rd-party vendor. These should all include the most recent security patches.
The Intellij team would be doing users a disservice if they provided an easy way for users to download an old and potentially insecure OpenJDK Java 17 build.
OpenJDK is basically a source only project (though they do release reference binaries for the first six months, which usually results in three releases, e.g. 17.0.0 - 17.0.2). After those three months, newer releases are only available through the vendors (e.g. for Java 17.0.5). All those listed are variants of OpenJDK 17 (except IBM Semeru, which is OpenJ9, which itself is a variant of OpenJDK). And bar vendor specific extras, or optional features like garbage collectors, they are basically the same, and have been tested for compliance with the Java specification.
In the Java world, you pick a vendor, and use its binaries instead of the binaries from OpenJDK itself (which generally don't go further then x.0.2, while vendor specific versions continue to receive updates if they are LTS versions). Personally, I usually use Eclipse Temurin builds.