Comments (30)
Thanks for your response! Unfortunately it didn't work for me.
Could you try to set
...
"runtimes": [
{
"name": "JavaSE-17",
"path": "/usr/lib/jvm/java-17-openjdk",
"javadoc": "https://docs.oracle.com/en/java/javase/17/docs/api/",
"default": true
}
...
Could you access JDK 17 API?
You can also try to install the JDK source.
from eclipse.jdt.ls.
Thanks for your response! Unfortunately it didn't work for me.
Could you try to set
... "runtimes": [ { "name": "JavaSE-17", "path": "/usr/lib/jvm/java-17-openjdk", "javadoc": "https://docs.oracle.com/en/java/javase/17/docs/api/", "default": true } ...
Could you access JDK 17 API?
You can also try to install the JDK source.
Thanks @snjeza . Yes, that's what I meant, but forgot to include the actual javadoc
property that controls this 😆 . I think some distributions simply provide a separate source bundle for the JDK which eliminates the need for a javadoc bundle (assuming the space taken by the sources is not an issue).
from eclipse.jdt.ls.
JDT will give priority to Javadoc in the source even if a Javadoc URL is specified.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=549029
from eclipse.jdt.ls.
[Error - 16:30:18] Jun. 3, 2024, 4:30:18 p.m. java.net.ConnectException
at java.net.http/jdk.internal.net.http.HttpClientImpl.send(Unknown Source)
at java.net.http/jdk.internal.net.http.HttpClientFacade.send(Unknown Source)
at org.eclipse.jdt.ls.core.internal.managers.MavenCentralIdentifier.find(MavenCentralIdentifier.java:119)
at org.eclipse.jdt.ls.core.internal.managers.MavenCentralIdentifier.identifySha1(MavenCentralIdentifier.java:81)
at org.eclipse.jdt.ls.core.internal.managers.MavenCentralIdentifier.identify(MavenCentralIdentifier.java:72)
at org.eclipse.jdt.ls.core.internal.managers.MavenCentralIdentifier.identify(MavenCentralIdentifier.java:58)
at org.eclipse.jdt.ls.core.internal.managers.MavenSourceDownloader.discoverSource(MavenSourceDownloader.java:78)
at org.eclipse.jdt.ls.core.internal.managers.InvisibleProjectBuildSupport.discoverSource(InvisibleProjectBuildSupport.java:103)
at org.eclipse.jdt.ls.core.internal.HoverInfoProvider.computeHover(HoverInfoProvider.java:135)
at org.eclipse.jdt.ls.core.internal.handlers.HoverHandler.computeHover(HoverHandler.java:57)
at org.eclipse.jdt.ls.core.internal.handlers.HoverHandler.hover(HoverHandler.java:43)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$5(JDTLanguageServer.java:654)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: java.net.ConnectException
at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Unknown Source)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.AsyncSSLConnection.connectAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.Http2Connection.createAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.Http2ClientImpl.getConnectionFor(Unknown Source)
at java.net.http/jdk.internal.net.http.ExchangeImpl.get(Unknown Source)
at java.net.http/jdk.internal.net.http.Exchange.establishExchange(Unknown Source)
at java.net.http/jdk.internal.net.http.Exchange.responseAsyncImpl0(Unknown Source)
at java.net.http/jdk.internal.net.http.Exchange.responseAsyncImpl(Unknown Source)
at java.net.http/jdk.internal.net.http.Exchange.responseAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.MultiExchange.responseAsyncImpl(Unknown Source)
at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsyncImpl$7(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.uniHandleStage(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.handle(Unknown Source)
at java.net.http/jdk.internal.net.http.MultiExchange.responseAsyncImpl(Unknown Source)
at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsync0$2(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
at java.net.http/jdk.internal.net.http.HttpClientImpl$DelegatingExecutor.execute(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.completeAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.MultiExchange.responseAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.HttpClientImpl.sendAsync(Unknown Source)
... 20 more
Caused by: java.nio.channels.UnresolvedAddressException
at java.base/sun.nio.ch.Net.checkAddress(Unknown Source)
at java.base/sun.nio.ch.Net.checkAddress(Unknown Source)
at java.base/sun.nio.ch.SocketChannelImpl.checkRemote(Unknown Source)
at java.base/sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
... 43 more
You're absolutely right. I got the exact same stacktrace on VS Code. The relevant code attempts to fetch the sources in order to compute the javadoc, but obviously if you disable your network interface, this fails, and we don't handle it gracefully. I think this should be easy to fix. though.
Update: The error is logged at
so the error doesn't interrupt execution, and likely the problem has to do with what occurs after. I'll need to investigate further.
from eclipse.jdt.ls.
From https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request :
You can try configuring this with java.configuration.runtimes
:
"settings": {
"java": {
...
...
"configuration": {
...
...
"runtimes": [
{
"name": "JavaSE-17",
"path": "/usr/lib/jvm/java-17-openjdk",
"default": true
}
}
}
}
from eclipse.jdt.ls.
@rgrunber Thanks for your response! Unfortunately it didn't work for me.
Looks like the class ClasspathEntry
is responsible for configuration, however I didn't find out how to use it.
from eclipse.jdt.ls.
What client are you using to consume JDT-LS ? Any of the ones mentioned at https://github.com/eclipse-jdtls/eclipse.jdt.ls/#clients ? Where is the ClasspathEntry
you're referring to ?
from eclipse.jdt.ls.
@rgrunber thanks for your patience.
I am using Monaco-languageclient for consumption, the file for ClaspathEntry
is org.eclipse.jdt.internal.core.ClasspathEntry
.
How did I encounter this:
I received error log messages from the client side while requesting a text document for the System
object (by hovering over code in the editor). The error stated that due to network unavailability, it couldn't retrieve documents from the Internet.
Upon investigating the error message, I discovered that the error is thrown from org.eclipse.jdt.internal.core.BinaryType.getAttachedJavadoc
. In this method, the document is requested from the location specified by the value of javadoc_location
.
Specifically, in the method org.eclipse.jdt.internal.core.JavaElement.getLibraryJavadocLocation
, the value is set in the constructor of org.eclipse.jdt.internal.core.ClasspathEntry
as the IClasspathAttribute[] extraAttributes
parameter.
Given its name, ClasspathEntry
, it seems like a configurable object. Hence, I posted my question here.
from eclipse.jdt.ls.
Init requst:
{
"..." : "...",
"params":{
"..." : "...",
"initilizationOptions": {
"settings": {
"java": {
"configuration": {
"runtime": {
"name": "JavaSE-11",
"path": "/usr/lib/jvm/java-11-openjdk-amd64",
"javadoc": "file:///usr/share/doc/openjdk-11-doc/api/",
"default": true
}
}
}
}
}
}
}
But it did not prevent me from getting error message (requesting docs from Internet) as:
Nov 24, 2023, 7:30:06 AM docs.oracle.com\ndocs.oracle.com\nJava Model Exception: java.net.UnknownHostException: docs.oracle.com
at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:941)
at org.eclipse.jdt.internal.core.BinaryType.getJavadocContents(BinaryType.java:1090)
at org.eclipse.jdt.internal.core.BinaryType.getAttachedJavadoc(BinaryType.java:1047)
at org.eclipse.jdt.ls.core.internal.javadoc.JavadocContentAccess2.getHTMLContent(JavadocContentAccess2.java:603)
at org.eclipse.jdt.ls.core.internal.javadoc.JavadocContentAccess2.getMarkdownContentReader(JavadocContentAccess2.java:2607)
at org.eclipse.jdt.ls.core.internal.HoverInfoProvider.computeJavadoc(HoverInfoProvider.java:311)
at org.eclipse.jdt.ls.core.internal.HoverInfoProvider.computeHover(HoverInfoProvider.java:150)
at org.eclipse.jdt.ls.core.internal.handlers.HoverHandler.computeHover(HoverHandler.java:57)
at org.eclipse.jdt.ls.core.internal.handlers.HoverHandler.hover(HoverHandler.java:43)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$7(JDTLanguageServer.java:580)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:75)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)\nCaused by: java.net.UnknownHostException: docs.oracle.com
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:229)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:609)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:305)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:508)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:373)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:207)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1187)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:193)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1592)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:334)
at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:874)
... 17 more\nCaused by: java.net.UnknownHostException: docs.oracle.com
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:229)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:609)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:305)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:508)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:373)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:207)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1187)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:193)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1592)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:334)
at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:874)
at org.eclipse.jdt.internal.core.BinaryType.getJavadocContents(BinaryType.java:1090)
at org.eclipse.jdt.internal.core.BinaryType.getAttachedJavadoc(BinaryType.java:1047)
at org.eclipse.jdt.ls.core.internal.javadoc.JavadocContentAccess2.getHTMLContent(JavadocContentAccess2.java:603)
at org.eclipse.jdt.ls.core.internal.javadoc.JavadocContentAccess2.getMarkdownContentReader(JavadocContentAccess2.java:2607)
at org.eclipse.jdt.ls.core.internal.HoverInfoProvider.computeJavadoc(HoverInfoProvider.java:311)
at org.eclipse.jdt.ls.core.internal.HoverInfoProvider.computeHover(HoverInfoProvider.java:150)
at org.eclipse.jdt.ls.core.internal.handlers.HoverHandler.computeHover(HoverHandler.java:57)
at org.eclipse.jdt.ls.core.internal.handlers.HoverHandler.hover(HoverHandler.java:43)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$7(JDTLanguageServer.java:580)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:75)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
from eclipse.jdt.ls.
Java Model Exception: java.net.UnknownHostException: docs.oracle.com
I think the above error might be some DNS issue. It worked for me to have the javadoc downloaded from the remote location. The final URL requested is something like https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html (assuming you hover over the String
type), which is valid.
As for why it didn't respect your setting, the format you provided just needs to be adjusted as we only support java.configuration.runtimes
as a list of runtime elements.
"runtime": {
"name": "JavaSE-11",
"path": "/usr/lib/jvm/java-11-openjdk-amd64",
"javadoc": "file:///usr/share/doc/openjdk-11-doc/api/",
"default": true
}
should become :
"runtimes": [
{
"name": "JavaSE-11",
"path": "/usr/lib/jvm/java-11-openjdk-amd64",
"javadoc": "file:///usr/share/doc/openjdk-11-doc/api/",
"default": true
}
]
See
from eclipse.jdt.ls.
I fixed the runtime
and it looks like this now:
{
"params":{
"initializationOptions":{
"settings": {
"java": {
"configuration": {
"runtime": [
{
"name": "JavaSE-17",
"path": "/usr/lib/jvm/java-17-openjdk-amd64",
"javadoc": "/usr/lib/jvm/java-17-openjdk-amd64/docs/api",
"default": true
}
]
}
}
}
}
}
}
unfortunately, it still didn't work.
Accroding to
javadoc
is invalid. However I did not get any error logs while setting a invalid value.from eclipse.jdt.ls.
@armanim Could you show your .classpath file?
from eclipse.jdt.ls.
@snjeza I didn't find the .classpath
file.
I downloaded jdtls from eclipse snapshot repository: jdtls
from eclipse.jdt.ls.
I didn't find the .classpath file.
Could you check your project root directory or <your_workspace>/redhat.java/jdt_ws/.metadata/.plugins/org.eclipse.core.resources/.projects/<your_project_name>/.classpath
from eclipse.jdt.ls.
I didn't find the .classpath file.
Could you check your project root directory or
<your_workspace>/redhat.java/jdt_ws/.metadata/.plugins/org.eclipse.core.resources/.projects/<your_project_name>/.classpath
There are two .classpath
files.
/jdt.ls.java.project/.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
/workspace-xxxx/.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="_"/>
<classpathentry kind="output" path="bin"/>
</classpath>
from eclipse.jdt.ls.
Could you try the following:
- stop your client
- remove workspace-xxx
- start your client
from eclipse.jdt.ls.
Could you try the following:
stop your client
remove workspace-xxx
start your client
the workspace-xxx created again. And content of .classpath file is the same.
from eclipse.jdt.ls.
What project are you using? Maven, Gradle, Eclipse?
from eclipse.jdt.ls.
What project are you using? Maven, Gradle, Eclipse?
Single Java file in the workspace directory.
from eclipse.jdt.ls.
Could you try to run
$ ls /usr/lib/jvm/java-17-openjdk-amd64/bin
$ ls /usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip
How did you set up monaco-languageclient?
from eclipse.jdt.ls.
Could you try to run
$ ls /usr/lib/jvm/java-17-openjdk-amd64/bin $ ls /usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip
How did you set up monaco-languageclient?
$ ls /usr/lib/jvm/java-17-openjdk-amd64/bin
jar java javadoc jcmd jdb jdeps jhsdb jinfo jmap jpackage jrunscript jstack jstatd rmiregistry
jarsigner javac javap jconsole jdeprscan jfr jimage jlink jmod jps jshell jstat keytool serialver
$ ls /usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip
/usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip
and src.zip
is a invalid link file whick linked to nothing.
$ cat /usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip
cat: /usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip: No such file or directory
This is how I setup monaco-languageclient
monaco.editor.create(document.getElementById('container')!, {
model: monaco.editor.createModel(value, 'java', monaco.Uri.parse('file:///tmp/workspace/a.java')),
glyphMargin: true,
lightbulb: {
enabled: true
}
});
function createLanguageClient (transports: MessageTransports): MonacoLanguageClient {
return new MonacoLanguageClient({
name: 'Sample Language Client',
clientOptions: {
workspaceFolder: {
uri: monaco.Uri.parse('file:///tmp/workspace/'),
name: 'monaco-languageclient',
index: 0
},
documentSelector: ['java'],
initializationOptions: {
settings: {
java: {
configuration: {
runtime: [{
name: 'JavaSE-17',
path: '/usr/lib/jvm/java-17-openjdk-amd64',
javadoc: '/usr/lib/jvm/java-17-openjdk-amd64/docs/api',
default: true
}]
}
}
}
}
}
});
And Im using a relatively older version of it. the last commit is fbc2f1e31
from Date: Wed Jun 22 23:00:40 2022 +0200
from eclipse.jdt.ls.
and src.zip is a invalid link file whick linked to nothing.
Could you try
$ ls -l /usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip
You can also try to reinstall java-17-openjdk.
from eclipse.jdt.ls.
and src.zip is a invalid link file whick linked to nothing.
Could you try
$ ls -l /usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip
You can also try to reinstall java-17-openjdk.
$ ls -l /usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip
lrwxrwxrwx 1 root root 24 Oct 31 23:39 /usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip -> ../../openjdk-17/src.zip
from eclipse.jdt.ls.
Could you try to run
$ sudo rm -rf /usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip
$ sudo ln -s /usr/lib/jvm/openjdk-17/src.zip /usr/lib/jvm/java-17-openjdk-amd64/lib/src.zip
from eclipse.jdt.ls.
What is the proper way to set javadoc
in runtimes
if the JavaDoc of the JDK is a ZIP file downloaded from Oracle? Is it:
javadoc = "/opt/jdk-21.0.3_doc-all.zip",
orjavadoc = "/opt/jdk-21.0.3_doc-all.zip!/docs/api",
?
IntelliJ Idea uses the second notation when I pointed the JavaDoc of the JDK to the ZIP file in Project structure -> SDKs window. (I know that Idea doesn't use JDTLS; just FYI).
from eclipse.jdt.ls.
I tried a zip file path (1) and that seems to work for me. I think URLs are also supported.
from eclipse.jdt.ls.
@rgrunber I tried option 1 after deleting the JDK's src.zip and disconnecting from the Internet. The documentation tooltip in NeoVim did not show the documentation in that case, just the function signature. PFA the screenshot. (I tried option 2 also in the same scenario; that too didn't work.)
@cypher256's comment mentions that the source always gets priority over the Javadoc. I think the Javadoc is not considered in any scenario by jdtls, if it is a ZIP file.
from eclipse.jdt.ls.
Do you have a sample of what your configuration file looks like for the setting under neovim ?
from eclipse.jdt.ls.
Here is my relevant Lua configuration file for NeoVim. I took it from AstroNvim. Jdtls version is 1.35.0.
local home = os.getenv "HOME"
---@type LazySpec
return {
{
"mfussenegger/nvim-jdtls",
opts = {
settings = {
java = {
configuration = {
runtimes = {
{
name = "JavaSE-21",
path = home .. "/.sdkman/candidates/java/21.0.3-tem",
javadoc = "/opt/jdk-21.0.3_doc-all.zip",
default = true,
},
{
name = "JavaSE-17",
path = home .. "/.sdkman/candidates/java/17.0.11-tem",
},
{
name = "JavaSE-11",
path = home .. "/.sdkman/candidates/java/11.0.23-tem",
},
},
},
},
format = {
enabled = true,
settings = { -- you can use your preferred format style
url = "https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml",
profile = "GoogleStyle",
},
},
},
},
},
}
from eclipse.jdt.ls.
These are the NeoVim LSP logs.
[START][2024-06-03 19:53:36] LSP logging initiated
[ERROR][2024-06-03 19:53:36] .../vim/lsp/rpc.lua:734 "rpc" "java" "stderr" "WARNING: Using incubator modules: jdk.incubator.vector\n"
[ERROR][2024-06-03 19:53:37] .../vim/lsp/rpc.lua:734 "rpc" "java" "stderr" "Jun 03, 2024 7:53:37 PM org.apache.aries.spifly.BaseActivator log\nINFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic\n"
[ERROR][2024-06-03 19:53:37] .../vim/lsp/rpc.lua:734 "rpc" "java" "stderr" "Jun 03, 2024 7:53:37 PM org.apache.aries.spifly.BaseActivator log\nINFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic\n"
[ERROR][2024-06-03 19:53:39] ...lsp/handlers.lua:535 "Jun 3, 2024, 7:53:39 PM Failed to load extension bundles \nLoad bundle list\norg.eclipse.core.runtime.CoreException: Load bundle list\n\tat org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.loadBundles(BundleUtils.java:173)\n\tat org.eclipse.jdt.ls.core.internal.handlers.InitHandler.handleInitializationOptions(InitHandler.java:114)\n\tat org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.initialize(BaseInitHandler.java:64)\n\tat org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.initialize(JDTLanguageServer.java:284)\n\tat java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:580)\n\tat org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$recursiveFindRpcMethods$0(GenericEndpoint.java:65)\n\tat org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)\n\tat org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:272)\n\tat org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:201)\n\tat org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$1(ParentProcessWatcher.java:144)\n\tat org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)\n\tat org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)\n\tat org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\nContains: Failed to get bundleInfo for bundle from /home/fci1614/.local/share/nvim/mason/share/java-test/com.microsoft.java.test.runner-jar-with-dependencies.jar\n"
[WARN][2024-06-03 19:53:41] ...lsp/handlers.lua:137 "The language server jdtls triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[ERROR][2024-06-03 19:53:41] ...lsp/handlers.lua:535 "Jun 3, 2024, 7:53:41 PM Command _java.reloadBundles.command not supported on client"
[ERROR][2024-06-03 19:53:41] .../vim/lsp/rpc.lua:734 "rpc" "java" "stderr" "Jun 03, 2024 7:53:41 PM com.microsoft.java.debug.plugin.internal.JavaDebuggerServerPlugin start\nINFO: Starting com.microsoft.java.debug.plugin\n"
[ERROR][2024-06-03 19:53:47] .../vim/lsp/rpc.lua:734 "rpc" "java" "stderr" "Jun 03, 2024 7:53:47 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\nWARNING: Unmatched cancel notification for request id 14\n"
[ERROR][2024-06-03 19:53:49] .../vim/lsp/rpc.lua:734 "rpc" "java" "stderr" "Jun 03, 2024 7:53:49 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\nWARNING: Unmatched cancel notification for request id 44\n"
[ERROR][2024-06-03 19:54:01] ...lsp/handlers.lua:535 "Jun 3, 2024, 7:54:01 PM HTTP connect timed out\nHTTP connect timed out\njava.net.http.HttpConnectTimeoutException: HTTP connect timed out\n\tat java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:945)\n\tat java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:133)\n\tat org.eclipse.jdt.ls.core.internal.managers.MavenCentralIdentifier.find(MavenCentralIdentifier.java:119)\n\tat org.eclipse.jdt.ls.core.internal.managers.MavenCentralIdentifier.identifySha1(MavenCentralIdentifier.java:81)\n\tat org.eclipse.jdt.ls.core.internal.managers.MavenCentralIdentifier.identify(MavenCentralIdentifier.java:72)\n\tat org.eclipse.jdt.ls.core.internal.managers.MavenCentralIdentifier.identify(MavenCentralIdentifier.java:58)\n\tat org.eclipse.jdt.ls.core.internal.managers.MavenSourceDownloader.discoverSource(MavenSourceDownloader.java:78)\n\tat org.eclipse.jdt.ls.core.internal.managers.MavenBuildSupport.discoverSource(MavenBuildSupport.java:145)\n\tat org.eclipse.jdt.ls.core.internal.HoverInfoProvider.computeHover(HoverInfoProvider.java:135)\n\tat org.eclipse.jdt.ls.core.internal.handlers.HoverHandler.computeHover(HoverHandler.java:57)\n\tat org.eclipse.jdt.ls.core.internal.handlers.HoverHandler.hover(HoverHandler.java:43)\n\tat org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$5(JDTLanguageServer.java:666)\n\tat org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)\n\tat java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)\n\tat java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)\n\tat java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)\n\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)\n\tat java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)\n\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)\n\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)\nCaused by: java.net.http.HttpConnectTimeoutException: HTTP connect timed out\n\tat java.net.http/jdk.internal.net.http.MultiExchange.toTimeoutException(MultiExchange.java:585)\n\tat java.net.http/jdk.internal.net.http.MultiExchange.getExceptionalCF(MultiExchange.java:532)\n\tat java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsyncImpl$7(MultiExchange.java:452)\n\tat java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)\n\tat java.base/java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:950)\n\tat java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2372)\n\tat java.net.http/jdk.internal.net.http.MultiExchange.responseAsyncImpl(MultiExchange.java:444)\n\tat java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsync0$2(MultiExchange.java:346)\n\tat java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)\n\tat java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)\n\tat java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)\n\tat java.net.http/jdk.internal.net.http.HttpClientImpl$DelegatingExecutor.execute(HttpClientImpl.java:177)\n\tat java.base/java.util.concurrent.CompletableFuture.completeAsync(CompletableFuture.java:2719)\n\tat java.net.http/jdk.internal.net.http.MultiExchange.responseAsync(MultiExchange.java:299)\n\tat java.net.http/jdk.internal.net.http.HttpClientImpl.sendAsync(HttpClientImpl.java:1047)\n\tat java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:930)\n\t... 19 more\nCaused by: java.net.ConnectException: HTTP connect timed out\n\tat java.net.http/jdk.internal.net.http.MultiExchange.toTimeoutException(MultiExchange.java:586)\n\t... 34 more\n"
from eclipse.jdt.ls.
Related Issues (20)
- Tries to clean default workspace when it doesn't exist. HOT 1
- Doesn't revalidate project files after classpath changes if autobuild is off. HOT 6
- [Feature, Performance] - Native GraalWM Executable HOT 2
- references stop working; index file not found errors; deadlocks with autobuild.enabled = false and maxConcurrentBuilds=8 HOT 1
- [Feature] Browsing jar dependencies contents HOT 5
- Disabling maven importer prevents project from being imported at all. HOT 5
- Run the build test suite against the incubator javac branch HOT 2
- result of `textDocument/declaration` is [] HOT 2
- Enable PGP signing, instead of Eclipse CBI jar signing
- Gradle tests fail when running the build with Java 22 HOT 2
- Unsupported class file major version 61
- Autobuilding setting isn't applied until didChangeConfiguration is received.
- codeAction/resolve throws errors when your machine's processor count is too low. HOT 1
- Java Model Exception: Error in Java Model (code 969): src/main/.... [in app] does not exist HOT 13
- Maven support HOT 3
- Filter reported for workspace/willRename excludes folders/packages HOT 8
- Incoming call's hierarchy item's selectionRange behaves differently to all other (tested) servers HOT 1
- Outgoing calls hierarchies runs into NullPointerException if hashCode() is called HOT 4
- Outgoing call hierarchies sometimes duplicate the results HOT 2
- can't build project after latest jdt core updates (ArrayBinding cannot be cast to class ReferenceBinding) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eclipse.jdt.ls.