coder / code-server

VS Code in the browser
https://coder.com
MIT License
66.51k stars 5.45k forks source link

Java Pack Plugin does not detect JDK ? Broken #6751

Open av1155 opened 2 months ago

av1155 commented 2 months ago

Is there an existing issue for this?

OS/Web Information

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?

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.

code-asher commented 2 months ago

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).