Unpacked JDK archive does not contain a Java home: /home/gobbe/.gradle/.tmp/jdks/OpenJDK21U-jdk_x64_linux_hotspot_21-Eclipse-Temurin-2111441753919758025703.tmp
Installing Java through Home Manager, but unsure if JAVA_HOME is properly set
programs.java = {
enable = true;
package = pkgs.jdk17;
# it says it sets home.sessionVariables.JAVA_HOME = "${cfg.package.home}";
# but unsure if IDEA/gradle finds this $JAVA_HOME
};
In other words, I opened IDEA, cloned either repo A or B. Waited for imports, then restarted IDEA. Error.
wondering what dependancies I should tweak or env-vars I should add to let gradle see java home
*could also be that gradle atm is doing auto-install of java, and that java doesn’t have a proper nixos $JAVA_HOME - if so I wonder how to set gradle up to use a current install of java.
Either way have struggled with this awhile and heard others also have had this issue so wondering if there are any solutions
If I were you I would now look into what JAVA_HOME is, and what home.sessionVariables.JAVA_HOME (if you don’t already)
As I personnally do not, I can’t help you on this front
The reason I specifically have the Zulu JDK in there is because I was working with GTNH RFB, which aggressively wanted to download its own jdk and was only content with Zulu (I did not and still do not know enough to disable foojay-resolver or whatever it is called).
See my flake attached, maybe it helps you. I used direnv and launched intellij from the shell, but entering the shell with nix shell or using the direnv intellij plugin might also work, YMMV.