Skip to content
Discussion options

You must be logged in to vote

The problem was, in fact, that the environment variable is not being properly propagated to the jdtls binary. With how Nix operates, I am not entirely surprised. The following setup allows Lombok to function properly, although I am not sure which extent. LSP hover seems to be working at least, so that is a good start.

java = let
  jdtlsCache = "$XDG_CACHE_HOME/jdtls";
in {
  enable = true;
  lsp.package = pkgs.writeShellScriptBin "start-jdtls" ''
    ${lib.getExe pkgs.jdt-language-server} \
      -configuration ${jdtlsCache}/config -data ${jdtlsCache}/workspace \
      --jvm-arg="-javaagent:${pkgs.lombok.outPath}/share/java/lombok.jar"
  '';
};

I think .outPath can also be replaced with .bin

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@NotAShelf
Comment options

@muItilingualism
Comment options

@NotAShelf
Comment options

@NotAShelf
Comment options

Answer selected by muItilingualism
@muItilingualism
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants