jruby: Fix JAVA_HOME to support proper jmod support
This is investigation I've done in support of
https://github.com/jruby/jruby/issues/6608 where I noticed some funky
issues with JRuby and module loading.
Looks like that JRuby expects JAVA_HOME to have a directory called
`jmod`, which is consistent with the Java Module system.
Unfortunately, the top level directory for the `jre` or `jdk` /nix/store
entry is not a valid JAVA_HOME since it is missing that directory.
Instead it's set within `lib/openjdk`, and there is a passthru variable
set accordingly.
This fixes JRuby and follows many other derivations.
A simple search in the code-base shows that there are many other
packages that suffer this same bug.
commitbfcd4b0e2a96be68d5142fda63e04da979e8b0ae
authorFarid Zakaria <fmzakari@google.com>
dateThu 11 Mar 2021, 15:59 (6 years ago)
parent0867f62
pkgs/development/interpreters/jruby/default.nix+1−1
@@ -23,7 +23,7 @@ jruby = stdenv.mkDerivation rec {
2323
2424 for i in $out/bin/jruby{,.bash}; do
2525 wrapProgram $i \
26− --set JAVA_HOME ${jre}
26+ --set JAVA_HOME ${jre.home}
2727 done
2828
2929 ln -s $out/bin/jruby $out/bin/ruby