Open ony opened 6 months ago
In the README.md
it says that it "Supports compiling projects from Java 1.5 through 19", so the best thing to do for now, as you just did, is to pin the jdk version to jdk17
.
I'll open a PR
@TomaSajt From the eclipse.jdt.ls README, as you noted it says
Supports compiling projects from Java 1.5 through 19
However this isn't any indication of what version the JDK running jdt.ls needs to be. That is mentioned further down under "Requirements":
The language server requires a runtime environment of Java 17 (at a minimum) to run
So Java 19 should work fine.
Unsupported class file major version 63
@ony As you noted, you are using Gradle 7.4.2 which only only supports up to JDK 17. Gradle 7.6 adds support for JDK 19.
So the problem here isn't that the package should be using JDK 17, it's that the runtime is impure because it uses the environment (in your case /home/mykola/.gradle/caches/7.4.2/...
) instead of a fixed gradle version.
@TomaSajt I think the right approach here would be to modify this package to ensure jdk19
is used (not jdk
because then it will break as soon as jdk
points to v21) and the ensure the right Gradle version is being used.
I'm going to comment in your PR #297556 with more thoughts.
Thanks for the reply, and by the way, AFAICT, jdk
already points to jdk21
@ony I think you are not actually using the current jdt.ls package. I see that because you are executing jdt-language-server
and this changed in PR #279285. So actually, the PR from @TomaSajt cannot address your issue unless you upgrade.
I think you can use your workaround with the override to jdk17
for now, and eventually, after the PR is merged, update to the new version.
As you noted, you are using Gradle 7.4.2 which only only supports up to JDK 17. Gradle 7.6 adds support for JDK 19.
So the problem here isn't that the package should be using JDK 17, it's that the runtime is impure because it uses the environment (in your case
/home/mykola/.gradle/caches/7.4.2/...
) instead of a fixed gradle version.
@matt-snider , sorry for late follow-up. Honestly, I was not sure why folder name is 7.4.2
. gradle
(that I mentioned) for nixos-23.11
(at least revision I'm on) uses 8.4.
But after checking I think it is just bundled with Eclipse JDT
zsh% find /nix/store/15dvj1sywr30z2j9ffdh07kgy75jr010-jdt-language-server-1.26.0 | rg gradle
/nix/store/15dvj1sywr30z2j9ffdh07kgy75jr010-jdt-language-server-1.26.0/share/java/plugins/org.gradle.toolingapi_7.4.2.v20220712-0930-s.jar
I think you are not actually using the current jdt.ls package. I see that because you are executing
jdt-language-server
and this changed in PR #279285. So actually, the PR from @TomaSajt cannot address your issue unless you upgrade.
Yes. Thank you. I just faced some other issues during upgrade to more recent revision that I need to look into.
With this issue I mostly wanted to share my findings about the fact that use of jdk
with Eclipse JDT without any other modifications may suffer from reducing functionality. Pinning dependency is only one thought I came up with.
Describe the bug
jdt-language-server
is not fully usable in NixOS 23.11 as Gradle fails due to Java version incompatibility.Eclipse JDT language server configured to use
jdk
https://github.com/NixOS/nixpkgs/blob/79baff8812a0d68e24a836df0a364c678089e2c7/pkgs/development/tools/language-servers/jdt-language-server/default.nix#L5
And it is by default
jdk19
as perhttps://github.com/NixOS/nixpkgs/blob/79baff8812a0d68e24a836df0a364c678089e2c7/pkgs/top-level/all-packages.nix#L16469
And there are no overrides for
jdt-language-server
intop-level/all-packages.nix
https://github.com/NixOS/nixpkgs/blob/79baff8812a0d68e24a836df0a364c678089e2c7/pkgs/top-level/all-packages.nix#L18377
Steps To Reproduce
Steps to reproduce the behavior:
nvim-jdtls
rm -rvf ~/.cache/jdtls ~/.gradle
.:JdtShowLogs
~/.cache/jdtls/workspace/.metadata/.log
notice errorsNote that major version 63 corresponds to Java 19.
Expected behavior
A clear and concise description of what you expected to happen.
(no errors)
Additional context
Overriding
jdk
to usejdk17
(matching Gradle version) makes it workNotify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result."x86_64-linux"
Linux 6.6.18, NixOS, 23.11 (Tapir), 23.11.20240301.79baff8
yes
yes
nix-env (Nix) 2.18.1
"nixos-21.11.334684.1158f346391"
"nixpkgs-unstable-21.11pre310022.14b0f20fa1f"
/nix/var/nix/profiles/per-user/root/channels/nixos
Latest update of
nixpkgs
for home manger:79baff8812a0d68e24a836df0a364c678089e2c7
2024-03-01T17:18:46 CETAdd a :+1: reaction to issues you find important.