[Nix-dev] Make Firefox/Chrome use OpenJDK instead of Oracle JDK?

Chad Joan chadjoan at gmail.com
Sun Feb 15 00:06:08 CET 2015


Hello!

Is it possible to make Firefox/Chrome use OpenJDK instead of Oracle JDK?
If so, how?

I have read this article: https://nixos.org/wiki/Enable_Browser_Plugins

Here is my configuration.nix: http://pastebin.com/hA2eV7TM

In my first attempt, I tried to follow the wiki advice, including the "jre
= true" suggestion, but with ignoring the suggestion to download Oracle JDK
in advance.  Predictably, when I ran "nixos-rebuild switch", it failed and
complained about needing Oracle JDK to be manually downloaded.

Next, used the same configuration, but with one exception: I tried adding
pkgs.jdk to my environment.systemPackages list.  This is the attribute name
I get when I run 'nix-env -qaP --description ".*jdk.*"' (I still wonder why
that query doesn't bring up the Oracle JDK as well...).  This failed the
same way as the first attempt.

I am suspecting that pkgs.jdk doesn't fulfill the JDK/JRE dependency given
by firefoxWrapper.  This would be unintuitive to me, because *any* JDK
should be able to satisfy a JDK/JRE dependency.  Hopefully I just
misunderstand how NixOS is resolving dependencies :)

I am trying to avoid the Oracle JRE because I don't want it to bug me with
a fetch restriction every time a system update bumps my Java version.  I've
been through this with Gentoo, and it has made me put extra effort into
avoiding things with licenses that require manual downloading.

At some level, I am hoping to find something analogous to (or capable of
replacing) Gentoo's virtual packages.  "virtual" packages in Gentoo would
be used for things like Java, where there are multiple implementations for
a piece of software.  A package (ex: firefox) can depend on a virtual
package (ex: jre) to avoid locking the admin into a specific
implementation, and a virtual package can be installed by installing any
one of its implementations.

Thanks in advance!
- Chad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150215/ad3680c6/attachment-0001.html 


More information about the nix-dev mailing list