Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java env issues #248

Open
RiedleroD opened this issue Apr 20, 2023 · 1 comment
Open

java env issues #248

RiedleroD opened this issue Apr 20, 2023 · 1 comment

Comments

@RiedleroD
Copy link

I'm using this inside kate on arch linux, with the recommended lsp config and JAVA_HOME=/usr/lib/jvm/default/ (which is openjdk 11 in this case).
docs work …sometimes …more or less. Not inside the function, but in the function parameters. And it shows me the source, not the docs.
Autocomplete only show keywords - and not even at the correct place, it recommends me abstract, class, etc. inside a function.

I assume it's something to do with my setup, but I don't know any further. The log suggests it kinda finds the correct java, but also not? idk man

I've got jdk11-openjdk, jre11-openjdk, jre11-openjdk-headless, openjdk11-doc and openjdk11-src installed if that makes any difference.

log:

[09:08:49  LSP Client Log] Started server java@/home/riedler: /usr/bin/java-language-server
[09:08:49  LSP Server Log] java@/home/riedler
09:08:49.315	INFO	LSP connect	Reading messages from queue...
[09:08:49  LSP Server Log] java@/home/riedler
09:08:49.315	INFO	LSP$1MessageReader run	Placing incoming messages on queue...
[09:08:55  LSP Server Log] java@/home/riedler
09:08:55.423	INFO	ScanClassPath jdkTopLevelClasses	Searching for top-level classes in the JDK
[09:08:55  LSP Server Log] java@/home/riedler
09:08:55.517	INFO	ScanClassPath jdkTopLevelClasses	Found 5993 classes in the java platform
[09:08:55  LSP Server Log] java@/home/riedler
Class path:
Doc path:
[09:08:55  LSP Server Log] java@/home/riedler
09:08:55.548	INFO	Docs findSrcZip	Found /usr/lib/jvm/default/lib/src.zip
[09:08:55  LSP Server Log] java@/home/riedler
09:08:55.592	INFO	ScanClassPath classPathTopLevelClasses	Searching for top-level classes in 0 classpath locations
[09:08:55  LSP Server Log] java@/home/riedler
09:08:55.596	INFO	ScanClassPath classPathTopLevelClasses	Found 0 classes in classpath
[09:08:55  LSP Server Log] java@/home/riedler
09:08:55.702	INFO	LSP$1MessageReader peek	Cannot cancel request 2 because it has already started
[09:08:55  LSP Server Log] java@/home/riedler
09:08:55.751	INFO	CompletionProvider complete	Complete at Client.java(6,3)...
[09:08:55  LSP Server Log] java@/home/riedler
09:08:55.751	INFO	Parser parseJavaFileObject	...using cached parse
09:08:55.753	WARNING	ReusableCompiler getTask	Options changed from [-classpath, , --add-modules, ALL-MODULE-PATH, -proc:none, -g, -Xlint:cast, -Xlint:deprecation, -Xlint:empty, -Xlint:fallthrough, -Xlint:finally, -Xlint:path, -Xlint:unchecked, -Xlint:varargs, -Xlint:static] to [-classpath, , --add-modules, ALL-MODULE-PATH, -proc:none, -g, -Xlint:cast, -Xlint:deprecation, -Xlint:empty, -Xlint:fallthrough, -Xlint:finally, -Xlint:path, -Xlint:unchecked, -Xlint:varargs, -Xlint:static], creating new compiler
[09:08:55  LSP Server Log] java@/home/riedler
09:08:55.836	INFO	CompletionProvider compileAndComplete	...compiled in 81ms
[09:08:55  LSP Server Log] java@/home/riedler
09:08:55.840	INFO	CompletionProvider logCompletionTiming	...found 11 items in 86 ms
[09:08:55  LSP Server Log] java@/home/riedler
09:08:55.844	INFO	Parser parseJavaFileObject	...using cached parse
[09:08:56  LSP Server Log] java@/home/riedler
09:08:56.045	INFO	JavaLanguageServer lint	Lint 1 files...
[09:08:56  LSP Server Log] java@/home/riedler
09:08:56.058	INFO	JavaLanguageServer lint	...compiled in 12 ms
[09:08:56  LSP Server Log] java@/home/riedler
09:08:56.078	INFO	JavaLanguageServer lint	...published in 32 ms
[09:08:57  LSP Server Log] java@/home/riedler
09:08:57.217	INFO	JavaLanguageServer lint	Lint 1 files...
[09:08:57  LSP Server Log] java@/home/riedler
09:08:57.238	INFO	JavaLanguageServer lint	...compiled in 20 ms
[09:08:57  LSP Server Log] java@/home/riedler
09:08:57.242	INFO	JavaLanguageServer lint	...published in 24 ms
[09:08:58  LSP Server Log] java@/home/riedler
09:08:58.783	INFO	JavaLanguageServer lint	Lint 1 files...
[09:08:58  LSP Server Log] java@/home/riedler
09:08:58.796	INFO	JavaLanguageServer lint	...compiled in 12 ms
[09:08:58  LSP Server Log] java@/home/riedler
09:08:58.797	INFO	JavaLanguageServer lint	...published in 13 ms
@brown
Copy link
Contributor

brown commented May 29, 2023

The log output you included contains:

Class path:
Doc path:

which indicates the Java language server has not been supplied with a Java classpath or documentation path. Lack of these may be contributing to the problems you see. Consult Kate's documentation to find out how you can make it provide useful java.classPath and java.docPath values to the language server during initialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants