Buidling IntelliJ with the JDK included

Hey there folks!
I’m still playing around with NixOS in my VM, so that once I’m comfortable with my config I can just use it on bare metal!
I must say I really enjoy the ecosystem and the idea behind it thus far, even though I don’t quite understand all the ins and outs.
One thing that I read a couple of times over the past days is that it’s not recommended to install compilers on a system or user level, but rather on a per-project basis.
My question now is, is there a way to give IntelliJ the latest stable jdk as a build input, so that it can access it for linting, debugging and whatnot, but also so that the rest of my system does not have access to it, keeping it relatively isolated.
I am unsure whether my train of thought is right, so please feel free to correct me!

Thanks in advance. :slight_smile: