scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.08k stars 331 forks source link

[Java 8] Java support not working because of missing tools.jar #6043

Open adpi2 opened 8 months ago

adpi2 commented 8 months ago

Describe the bug

There is no hovering and no auto-completion.

There is no auto-completion and the debugger is frozen.

Expected behavior

Hovering and auto-completion should work. We should have auto-completion in the debug console. The debugger should not freeze.

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

v1.2.0

Extra context or search terms

The problem is that JavaMetalsGlobal depends on com.sun.source.util.TreePath which is not in the JDK 8 app loader. It throws a NoClassDefFoundError.

To fix this, Metals should start with the tools.jar in its classpath.

ayoub-benali commented 7 months ago

Hello, I have the same exception but without using the debugger. textDocument/definition inside a java file causes the exception and then afterwards empty results are returned to the client. Should I create a separate issue for this ?

EDIT: I am also on java 8

tgodzik commented 7 months ago

I think this might be the same issue :thinking:

adpi2 commented 7 months ago

Should I create a separate issue for this ?

It looks like the same issue.