JRE required for Libre Base

Hi, i have plasma as my window manager and have installed Libreoffice by

environment.systemPackages = with pkgs; [ libreoffice ];

when i launch Base im getting the error as JRE required. when i search for nixpackages i couldnt find anything relating to JRE. when i search for JRE on the same nixpackages page, i could see jre8, jre8-plugin, jre-minimal, jre-headless etc. can anyone say how to find which one to go for ?

I couldn’t find any information about which version Base needs.

I think you’re best bet is to try some and see what happens.

  • jre8 is Java 8, which is pretty old
  • jre-minimal is currently Java 21.

Perhaps try them in reverse order of “newness”:

  • jre-minimal is currently Java 21. So is temurin-jre-bin
  • temurin-jre-bin-20
  • jre17-mininal or temurin-jre-bin-17
  • temurin-jre-bin-11

Another option is to install a jdk. I think there are more jdk packages than jre packages.

I’ve never needed Base but I’ve just tried to launch and I don’t have the issue and my libreoffice installation is similar to you (I also use plasma but I don’t think it’s relevant). The JRE should be provided: nixpkgs/pkgs/applications/office/libreoffice/default.nix at 27c13997bf450a01219899f5a83bd6ffbfc70d3c · NixOS/nixpkgs · GitHub

It’s configured to use jre17_minimal, with some specific modules.

What channel are you using?

I installed jre_minimal (Version: 19.0.2+7). Prior to this installation i was getting that error. But now, it crashes without any error message


my nix-channel --list output is

home-manager https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz

Correct me if im wrong. That above cmd is to list out channels when flakes is not used, right ?
Im using flakes and how do i list out channels when flakes is being used using cmd ?

Forgive me if im being silly. Im a noob and trying to build my system day by day and trying to understand through every step.

I installed my system with 23.05 version and later i added flakes. then updated the version to 23.11 by changing the flake.nix file. So these are the current channels im running if im not wrong (correct me if im wrong please)

  inputs = {
    nixpkgs.url = "nixpkgs/nixos-23.11";
    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";

    home-manager.url = "github:nix-community/home-manager/release-23.11";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

Indeed channels are global references and should not be used by your flake config.

While I’m glad that you’re unblocked by adding jre_minimal I can’t imagine why you need to, that smells like a bug to me.

okay, im ditching the thought of using Base. But before that i have some followup questions just for the sake of understanding.

  1. How do i find what all the channels that my system is currently using or following ?
  1. And, what do you mean by, unblocked by adding… .
  1. nix-channel --list, as you’ve previously used, but you need to run it as root to see the one used by a non-flake nixos configuration.
    I don’t have that much experience with flakes but I believe that not being dependent on channels is one of the purpose of flakes: you have to be explicit about your inputs.
    With flakes, if you use a repository as input, like nixpkgs, the current commit hash of that repository is stored in a local flake.lock file so it doesn’t change unless you want it to. As opposed to channels, which are global and where an update impacts potentially many nix files.

  2. What I meant by “unblocked” might be a misunderstanding, I thought you’ve solved your error of missing the JRE by adding it as an explicit dependency. Which you shouldn’t need to do, adding libreoffice should bring all that it requires, including jre_minimal.