code-server icon indicating copy to clipboard operation
code-server copied to clipboard

Java Pack Plugin does not detect JDK ? Broken

Open av1155 opened this issue 10 months ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

  • Web Browser: Blink App
  • Local OS: iOS
  • Remote OS: Debian GNU/Linux 12 (bookworm) aarch64
  • Remote Architecture: aarch64
  • code-server --version: latest

Raspberry Pi 5 Model B Rev 1.0

Steps to Reproduce

  1. Install Java JDK via atp or manually
  2. Export path on .zshrc file (ZSH shell default)
  3. Launch newest version of code-server with the Java Pack Plugin installed

Expected

Java should load after “Opening Project” and choosing the directory of the project.

Any Java file then should work perfectly normal and as expected, with syntax highlighting, LSP, running and debugging, etc

Actual

After update it says that JDK needs to be higher than JDK 8, I am using 21 and always did. I have not updated my Java version. Only thing that changed was the code-server version.

I tried using older versions of the Java Pack Plugin but it still did not work. I imagine it has to do with Code-Server update then because nothing has changed on my environment.

Logs

No response

Screenshot/Video

No response

Does this bug reproduce in native VS Code?

This cannot be tested in native VS Code

Does this bug reproduce in GitHub Codespaces?

I did not test GitHub Codespaces

Are you accessing code-server over a secure context?

  • [X] I am using a secure context.

Notes

It used to work perfectly well and I always used to program with my Java projects in code-server no issue; after update, this started happening and I cannot code anymore, unless I manually use the terminal which works as expected because java —version does work and everything is as expected. Only change is code-server version.

av1155 avatar Apr 10 '24 20:04 av1155

Does downgrading code-server make the plugins work again?

I imagine the plugin must be detecting the JDK using PATH? I see you are adding it using .zshrc but how are you launching code-server? If it is something like systemd then it would not read .zshrc so maybe the JDK you installed has not been added to the path in code-server's environment and it is finding the wrong JDK.

Edit: the plugin says it will also read JDK_HOME and JAVA_HOME, are those set?

In the worst case scenario, maybe you can configure the plugin with the path of the JDK (java.jdt.ls.java.home it seems).

code-asher avatar Apr 15 '24 21:04 code-asher

Closing as stale but feel free to comment if you come back to this.

code-asher avatar Jul 12 '24 00:07 code-asher