3

On NixOS, I am trying to install java in order to compile my code from the command line.

I do not see the java compiler listed anywhere in the list of available packages, queried by running nix-env -qaP '*' --description.

How do I install a java compiler on NixOS?

  • 3
    This page might help: nixos.org/nixos/packages.html it's a dynamic search page for NixOS' store. – Mioriin Nov 11 '17 at 4:50
  • 1
    Searching using a package name usually useless unless you know what you are looking for. Use package page mentioned above or add --description flag, for example, nix-env -qaP --description | grep -i java\.*devel – wizzup Nov 11 '17 at 6:58
6

There are two Java compilers available via Nixpkgs: OpenJDK and OracleJDK, named openjdk and oraclejdk, respectively.

Note that the OracleJDK doesn't seem to be available in the top-level expression, but you can certainly install the openjdk.

  • Thank you. I missed openjdk since I had been searching for java. – mherzl Nov 11 '17 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.