diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix index 262e52c2521..71a55c68290 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix @@ -3,6 +3,7 @@ { swingSupport ? true # not used for now , lib, stdenv , fetchurl +, setJavaClassPath }: let cpuName = stdenv.hostPlatform.parsed.cpu.name; @@ -30,7 +31,11 @@ let cpuName = stdenv.hostPlatform.parsed.cpu.name; ln -s $out/Contents/Home/* $out/ + # Propagate the setJavaClassPath setup hook from the JDK so that + # any package that depends on the JDK has $CLASSPATH set up + # properly. mkdir -p $out/nix-support + printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs # Set JAVA_HOME automatically. cat <> $out/nix-support/setup-hook diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix index a433a2f1321..e304f67bd75 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix @@ -5,6 +5,7 @@ , fetchurl , autoPatchelfHook , makeWrapper +, setJavaClassPath # minimum dependencies , alsaLib , fontconfig @@ -74,7 +75,11 @@ let result = stdenv.mkDerivation rec { # https://github.com/NixOS/nixpkgs/issues/57733 find "$out" -name 'libfreetype.so*' -delete + # Propagate the setJavaClassPath setup hook from the JDK so that + # any package that depends on the JDK has $CLASSPATH set up + # properly. mkdir -p $out/nix-support + printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs # Set JAVA_HOME automatically. cat <> "$out/nix-support/setup-hook"