coc-java icon indicating copy to clipboard operation
coc-java copied to clipboard

On Windows - coc-java appears to be running but no autocomplete

Open DasInternaut opened this issue 10 months ago • 18 comments

When I load a Java file into vim, another powershell window opens, running the following:

C:\Users\jason\AppData\Local\coc\extensions\coc-java-data\jdk-23.0.2-win32-x64\bin\java --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.fs=ALL-UNNAMED -Declipse.app

So it appears to be running, but I get no autocomplete.

From CocInfo:

`vim version: VIM - Vi IMproved 9.1 9010821 node version: v20.5.0 coc.nvim version: 0.0.82-d1ae7678 2025-03-30 00:03:08 +0800 coc.nvim directory: C:\Users\jason\vimfiles\plugged\coc.nvim term: undefined platform: win32

Log of coc.nvim

2025-04-07T12:28:52.723 INFO (pid:31628) [plugin] - coc.nvim initialized with node: v20.5.0 after 217 2025-04-07T12:28:52.760 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:01.392 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:02.017 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:02.618 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:03.024 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:03.524 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:03.897 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:04.396 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:04.925 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:05.438 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:05.873 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:06.540 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:10.592 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:10.951 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:11.386 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:11.896 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:12.295 INFO (pid:31628) [services] - LanguageClient Language Support for Java state change: stopped => starting 2025-04-07T12:29:12.304 INFO (pid:31628) [language-client-index] - Language server "java" started with 12524 2025-04-07T12:29:12.334 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:29:19.202 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:00.313 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:00.902 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:02.396 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:02.769 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:08.621 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:10.627 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:12.446 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:15.024 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:15.757 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:17.171 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:33.173 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:36.564 INFO (pid:31628) [attach] - receive notification: highlight [] 2025-04-07T12:30:43.579 INFO (pid:31628) [attach] - receive notification: showInfo []

I'm running vim from my project root (i.e. where my pom.xml resides).

DasInternaut avatar Apr 07 '25 11:04 DasInternaut

Need checkout the output of language server https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

chemzqm avatar Apr 07 '25 11:04 chemzqm

Ok, I've done the following:

So, I've added the following lanugage config (previously none-existent - didn't need it when trying on Linux):

    },
    "java": {
    "command": "jdlts",
    "filetypes": ["java"],
    "trace.server": "verbose"
    }
  }

Additionally, I added the following to the path:

C:\Users\jason\AppData\Local\coc\extensions\node_modules\coc-java\server\bin

On loading a Java file in vim, I now see the following error message:

[coc.nvim] Pending response rejected since connection got disposed.

Looing at CocInfo I see the following:

2025-04-07T17:04:53.066 INFO (pid:15224) [language-client-index] - Language server "languageserver.java" started with 27960 2025-04-07T17:04:53.091 INFO (pid:15224) [services] - LanguageClient java state change: stopped => starting 2025-04-07T17:04:53.092 ERROR (pid:15224) [language-client-client] - Server languageserver.java initialization failed. _ResponseError: Pending response rejected since connection got disposed at Object.dispose (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:20852:25) at Object.dispose (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:74268:31) at LanguageClient.handleConnectionClosed (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:75185:30) at LanguageClient.handleConnectionClosed (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:75662:15) at closeHandler (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:75172:16) at CallbackList.invoke (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:19011:35) at _Emitter.fire (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:19070:34) at closeHandler (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:20062:24) at CallbackList.invoke (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:19011:35) at _Emitter.fire (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:19070:34) { code: -32097, data: undefined } 2025-04-07T17:04:53.092 INFO (pid:15224) [services] - LanguageClient java state change: starting => stopped 2025-04-07T17:04:53.103 INFO (pid:15224) [language-client-index] - Language server "languageserver.java" started with 4900 2025-04-07T17:04:53.133 ERROR (pid:15224) [language-client-client] - Server languageserver.java initialization failed. _ResponseError: Pending response rejected since connection got disposed at Object.dispose (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:20852:25) at Object.dispose (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:74268:31) at LanguageClient.handleConnectionClosed (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:75185:30) at LanguageClient.handleConnectionClosed (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:75662:15) at closeHandler (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:75172:16) at CallbackList.invoke (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:19011:35) at _Emitter.fire (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:19070:34) at closeHandler (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:20062:24) at CallbackList.invoke (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:19011:35) at _Emitter.fire (C:\Users\jason\vimfiles\plugged\coc.nvim\build\index.js:19070:34) { code: -32097, data: undefined } 2025-04-07T17:04:53.344 INFO (pid:15224) [services] - LanguageClient Language Support for Java state change: stopped => starting 2025-04-07T17:04:53.369 INFO (pid:15224) [language-client-index] - Language server "java" started with 27300 2025-04-07T17:05:50.016 INFO (pid:15224) [attach] - receive notification: showInfo [] 2025-04-07T17:05:50.454 INFO (pid:15224) [attach] - receive notification: highlight [] 2025-04-07T17:05:52.346 INFO (pid:15224) [attach] - receive notification: highlight [] 2025-04-07T17:05:52.690 INFO (pid:15224) [attach] - receive notification: highlight []

Now, when I run CocCommand workspace.showOutput, I get a dialogue:

Image

Entering java or languageserver.java doesn't actually display anything in Vim. Does this write some logging somewhere?

DasInternaut avatar Apr 07 '25 16:04 DasInternaut

2025-04-07T17:04:53.133 ERROR (pid:15224) [language-client-client] - Server languageserver.java initialization failed. _ResponseError: Pending response rejected since connection got disposed

The server not started, so no output messages, need to check the log of jdtls on that case.

chemzqm avatar Apr 08 '25 05:04 chemzqm

Use configurations like:

  "java.trace.server": "verbose",
  "java.server.launchMode": "Standard",

chemzqm avatar Apr 08 '25 05:04 chemzqm

In my case, it opens a new terminal window that says "WARNING: Incubator modules: jdk.incubator.vector are being used." And autocompletion doesn't work, symbols or goto functions also are not working.

This is the terminal window. Image

AlfonsoG-dev avatar Apr 28 '25 21:04 AlfonsoG-dev

I'm facing a problem that I believe is related to this. When I start editing a .java file I get a new window that opens and stays open with the following contents:

Apr 29, 2025 12:19:35 PM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic
Apr 29, 2025 12:19:35 PM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic

And I get basically no working language server features.

:CocOpenLog shows:

2025-04-29T12:19:24.278 INFO (pid:6824) [plugin] - coc.nvim initialized with node: v22.14.0 after 337 2025-04-29T12:19:32.626 INFO (pid:6824) [configurations] - Add folder configuration from file: c:\Users\hepti\www\donna\vips.vim\coc-settings.json 2025-04-29T12:19:32.982 INFO (pid:6824) [services] - LanguageClient Language Support for Java state change: stopped => starting 2025-04-29T12:19:32.997 INFO (pid:6824) [language-client-index] - Language server "java" started with 11196 2025-04-29T12:19:33.191 INFO (pid:6824) [core-watchman] - watchman watching project: c:\Users\hepti\www\donna\vips 2025-04-29T12:19:40.961 INFO (pid:6824) [attach] - receive notification: runCommand [ 'workspace.showOutput' ] 2025-04-29T12:23:45.375 INFO (pid:6824) [attach] - receive notification: startCompletion [ {} ] 2025-04-29T12:23:46.902 INFO (pid:6824) [attach] - receive notification: startCompletion [ {} ] 2025-04-29T12:23:49.334 INFO (pid:6824) [attach] - receive notification: startCompletion [ {} ] 2025-04-29T12:28:14.601 INFO (pid:6824) [attach] - receive notification: openLog []

Additionally, there are rotating dots in (in a single character cell) my CoC statusline area that never go away.

Heptite avatar Apr 29 '25 18:04 Heptite

The jdt.ls failed to start, maybe latest jdt.js helps, try download jdt.ls from https://download.eclipse.org/jdtls/milestones/ and use configuration java.jdt.ls.directory, and run command :CocCommand java.clean.workspace to clean up the cache of current workspace.

chemzqm avatar Apr 30 '25 05:04 chemzqm

The jdt.ls failed to start, maybe latest jdt.js helps, try download jdt.ls from https://download.eclipse.org/jdtls/milestones/ and use configuration java.jdt.ls.directory, and run command :CocCommand java.clean.workspace to clean up the cache of current workspace.

Unfortunately this didn't make any difference.

Heptite avatar Apr 30 '25 06:04 Heptite

@chemzqm Is there any progress on this? Is there any information I can provide to help find a solution?

Heptite avatar May 28 '25 20:05 Heptite

    /**
     * The connection got disposed or lost and all pending responses got
     * rejected.
     */
    const PendingResponseRejected: -32097

No, need to check the server log or debug the server for this case. Or check the verbose output from coc-java and vscode-java to get the differences if vscode-java can work on vscode.

chemzqm avatar May 30 '25 11:05 chemzqm

C:\Users\jason\AppData\Local\coc\extensions\coc-java-data\jdk-23.0.2-win32-x64\bin\java --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.fs=ALL-UNNAMED -Declipse.app

Wrong arguments, which not include jdtls at all, so it won't work.

chemzqm avatar May 30 '25 14:05 chemzqm

@Heptite To temporarily workaround this issue, I changed bin to javaw vs java on Windows in .......\coc\extensions\node_modules\coc-java\lib\index.js.

Example:

exports2.JAVA_FILENAME = exports2.isWindows ? "javaw.exe" : "java";

sgraves66 avatar Jul 21 '25 16:07 sgraves66

@sgraves66 Unfortunately this didn't change anything for me. I still get a cmd window up with:

Jul 21, 2025 3:08:38 PM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic

And it just stays there, and I get no language server features available in Vim.

Heptite avatar Jul 21 '25 21:07 Heptite

@Heptite If it's using javaw.exe, it should not create a console window, so I suspect it still may be using java. The w at the end is required for this workaround.

If the w is there, then it's likely a different issue than what I've encountered.

sgraves66 avatar Jul 22 '25 18:07 sgraves66

@sgraves66 I made the change you suggested, but looking at the process listing it appears it's still loading java.exe instead of javaw.exe.

Heptite avatar Jul 22 '25 20:07 Heptite

In my case, it opens a new terminal window that says "WARNING: Incubator modules: jdk.incubator.vector are being used." And autocompletion doesn't work, symbols or goto functions also are not working.

This is the terminal window. Image

I'm facing the same problem. and if you hit "Enter" in this very terminal, it will complaint about malformed input of lsp protocol.

shiluotang avatar Aug 22 '25 19:08 shiluotang

Use configurations like:

"java.trace.server": "verbose", "java.server.launchMode": "Standard",

get some logging with these options, hope this may give some hints

log from coc\extensions\coc-java-data\jdt_ws_...\.metadata\.log

!SESSION 2025-08-23 03:38:13.986 -----------------------------------------------
eclipse.buildId=unknown
java.version=23.0.2
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN
Command-line arguments:  -data C:\Users\sheng\AppData\Local\coc\extensions\coc-java-data\jdt_ws_61e537fd1fa7597cf018b994e050bc96

!ENTRY org.eclipse.jdt.ls.core 1 0 2025-08-23 03:38:15.384
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started

!ENTRY org.eclipse.jdt.ls.core 1 0 2025-08-23 03:38:15.723
!MESSAGE Started org.eclipse.buildship.core 42ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2025-08-23 03:38:15.724
!MESSAGE Started org.eclipse.m2e.core 0ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2025-08-23 03:38:15.953
!MESSAGE Main thread is waiting

!ENTRY org.eclipse.jdt.ls.core 1 0 2025-08-23 03:38:16.609
!MESSAGE ProjectRegistryRefreshJob finished 885ms

log from coc\extensions\coc-java-data\client.log

2025-08-23T03:38:13.530 INFO (pid:17108) - Use the JDK from '' as the initial default project JDK.
2025-08-23T03:38:13.539 INFO (pid:17108) - Server configured with the following runtimes: [
  {
    "name": "JavaSE-21",
    "path": "C:\\Program Files\\Microsoft\\jdk-21.0.8.9-hotspot",
    "sources": "C:\\Program Files\\Microsoft\\jdk-21.0.8.9-hotspot\\lib\\src.zip",
    "default": true
  }
]
2025-08-23T03:38:13.556 INFO (pid:17108) - Starting Java server with: C:\Users\sheng\AppData\Local\coc\extensions\coc-java-data\jdk-23.0.2-win32-x64\bin\java --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -Xlog:disable -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=C:\Users\sheng\AppData\Local\coc\extensions\coc-java-data -jar C:\Users\sheng\AppData\Local\coc\extensions\node_modules\coc-java\server\plugins\org.eclipse.equinox.launcher_1.6.1000.v20250131-0606.jar -configuration C:\Users\sheng\AppData\Local\coc\extensions\coc-java-data\1.26.1\config_win -data C:\Users\sheng\AppData\Local\coc\extensions\coc-java-data\jdt_ws_61e537fd1fa7597cf018b994e050bc96
2025-08-23T03:38:13.585 INFO (pid:17108) - [Trace - 03:38:13] Sending request 'initialize - (0)'.
Params: {
    "processId": 17108,
    "rootPath": "c:\\Users\\sheng\\Documents\\myprojects\\java\\swagger-demo",
    "rootUri": "file:///c%3A/Users/sheng/Documents/myprojects/java/swagger-demo",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "undo",
                "normalizesLineEndings": true,
                "changeAnnotationSupport": {
                    "groupsOnLabel": false
                },
                "metadataSupport": true,
                "snippetEditSupport": true
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": true,
                "relativePatternSupport": true
            },
            "codeLens": {
                "refreshSupport": true
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "fileOperations": {
                "dynamicRegistration": true,
                "didCreate": true,
                "didRename": true,
                "didDelete": true,
                "willCreate": true,
                "willRename": true,
                "willDelete": true
            },
            "semanticTokens": {
                "refreshSupport": true
            },
            "inlayHint": {
                "refreshSupport": true
            },
            "textDocumentContent": {
                "dynamicRegistration": true
            },
            "inlineValue": {
                "refreshSupport": true
            },
            "diagnostics": {
                "refreshSupport": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                },
                "resolveSupport": {
                    "properties": [
                        "location.range"
                    ]
                }
            },
            "workspaceFolders": true
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true,
                "versionSupport": true,
                "tagSupport": {
                    "valueSet": [
                        1,
                        2
                    ]
                },
                "codeDescriptionSupport": true,
                "dataSupport": true
            },
            "filters": {
                "relativePatternSupport": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true,
                    "insertReplaceSupport": true,
                    "tagSupport": {
                        "valueSet": [
                            1
                        ]
                    },
                    "resolveSupport": {
                        "properties": [
                            "documentation",
                            "detail",
                            "additionalTextEdits"
                        ]
                    },
                    "labelDetailsSupport": true,
                    "insertTextModeSupport": {
                        "valueSet": [
                            1,
                            2
                        ]
                    }
                },
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                },
                "insertTextMode": 2,
                "completionList": {
                    "itemDefaults": [
                        "commitCharacters",
                        "editRange",
                        "insertTextFormat",
                        "insertTextMode"
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "activeParameterSupport": true,
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    }
                }
            },
            "references": {
                "dynamicRegistration": true
            },
            "definition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "hierarchicalDocumentSymbolSupport": true,
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                },
                "labelSupport": true
            },
            "codeAction": {
                "dynamicRegistration": true,
                "isPreferredSupport": true,
                "disabledSupport": true,
                "dataSupport": true,
                "honorsChangeAnnotations": false,
                "resolveSupport": {
                    "properties": [
                        "edit"
                    ]
                },
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                }
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true,
                "honorsChangeAnnotations": true,
                "prepareSupportDefaultBehavior": 1
            },
            "documentLink": {
                "dynamicRegistration": true,
                "tooltipSupport": true
            },
            "typeDefinition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "implementation": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "declaration": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true,
                "foldingRangeKind": {
                    "valueSet": [
                        "comment",
                        "imports",
                        "region"
                    ]
                },
                "foldingRange": {
                    "collapsedText": false
                }
            },
            "selectionRange": {
                "dynamicRegistration": true
            },
            "callHierarchy": {
                "dynamicRegistration": true
            },
            "linkedEditingRange": {
                "dynamicRegistration": true
            },
            "semanticTokens": {
                "dynamicRegistration": true,
                "tokenTypes": [
                    "namespace",
                    "type",
                    "class",
                    "enum",
                    "interface",
                    "struct",
                    "typeParameter",
                    "parameter",
                    "variable",
                    "property",
                    "enumMember",
                    "event",
                    "function",
                    "method",
                    "macro",
                    "keyword",
                    "modifier",
                    "comment",
                    "string",
                    "number",
                    "regexp",
                    "decorator",
                    "operator"
                ],
                "tokenModifiers": [
                    "declaration",
                    "definition",
                    "readonly",
                    "static",
                    "deprecated",
                    "abstract",
                    "async",
                    "modification",
                    "documentation",
                    "defaultLibrary"
                ],
                "formats": [
                    "relative"
                ],
                "requests": {
                    "range": true,
                    "full": {
                        "delta": true
                    }
                },
                "multilineTokenSupport": false,
                "overlappingTokenSupport": false,
                "serverCancelSupport": true,
                "augmentsSyntaxTokens": true
            },
            "inlayHint": {
                "dynamicRegistration": true,
                "resolveSupport": {
                    "properties": [
                        "tooltip",
                        "textEdits",
                        "label.tooltip",
                        "label.location",
                        "label.command"
                    ]
                }
            },
            "inlineCompletion": {
                "dynamicRegistration": true
            },
            "inlineValue": {
                "dynamicRegistration": true
            },
            "diagnostic": {
                "relatedInformation": true,
                "tagSupport": {
                    "valueSet": [
                        1,
                        2
                    ]
                },
                "codeDescriptionSupport": true,
                "dataSupport": true,
                "dynamicRegistration": true,
                "relatedDocumentSupport": true
            },
            "typeHierarchy": {
                "dynamicRegistration": true
            }
        },
        "window": {
            "showMessage": {
                "messageActionItem": {
                    "additionalPropertiesSupport": true
                }
            },
            "showDocument": {
                "support": true
            },
            "workDoneProgress": true
        },
        "general": {
            "staleRequestSupport": {
                "cancel": true,
                "retryOnContentModified": [
                    "textDocument/inlayHint",
                    "textDocument/semanticTokens/full",
                    "textDocument/semanticTokens/range",
                    "textDocument/semanticTokens/full/delta"
                ]
            },
            "regularExpressions": {
                "engine": "ECMAScript",
                "version": "ES2020"
            },
            "markdown": {
                "parser": "marked",
                "version": "7.0.5"
            },
            "positionEncodings": [
                "utf-16"
            ]
        }
    },
    "initializationOptions": {
        "bundles": [],
        "workspaceFolders": [
            "file:///c%3A/Users/sheng/Documents/myprojects/java/swagger-demo"
        ],
        "settings": {
            "java": {
                "enabled": true,
                "home": "C:\\Program Files\\Microsoft\\jdk-21.0.8.9-hotspot",
                "jdt": {
                    "ls": {
                        "directory": null,
                        "statusIcons": null,
                        "java": {
                            "home": null
                        },
                        "bundles": [],
                        "vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -Xlog:disable",
                        "javac": {
                            "enabled": false
                        },
                        "lombokSupport": {
                            "enabled": false
                        },
                        "protobufSupport": {
                            "enabled": true
                        },
                        "androidSupport": {
                            "enabled": false
                        }
                    }
                },
                "errors": {
                    "incompleteClasspath": {
                        "severity": "warning"
                    }
                },
                "configuration": {
                    "checkProjectSettingsExclusions": false,
                    "updateBuildConfiguration": "interactive",
                    "maven": {
                        "userSettings": null,
                        "globalSettings": null,
                        "notCoveredPluginExecutionSeverity": "warning",
                        "defaultMojoExecutionAction": "ignore"
                    },
                    "workspaceCacheLimit": 90,
                    "detectJdks": true,
                    "runtimes": [
                        {
                            "name": "JavaSE-21",
                            "path": "C:\\Program Files\\Microsoft\\jdk-21.0.8.9-hotspot",
                            "sources": "C:\\Program Files\\Microsoft\\jdk-21.0.8.9-hotspot\\lib\\src.zip",
                            "default": true
                        }
                    ]
                },
                "trace": {
                    "server": "verbose"
                },
                "import": {
                    "maven": {
                        "enabled": true,
                        "offline": {
                            "enabled": false
                        },
                        "disableTestClasspathFlag": false
                    },
                    "gradle": {
                        "enabled": true,
                        "wrapper": {
                            "enabled": true
                        },
                        "version": null,
                        "home": null,
                        "java": {
                            "home": null
                        },
                        "offline": {
                            "enabled": false
                        },
                        "arguments": null,
                        "jvmArguments": null,
                        "user": {
                            "home": null
                        },
                        "annotationProcessing": {
                            "enabled": true
                        }
                    },
                    "exclusions": [
                        "**/node_modules/**",
                        "**/.metadata/**",
                        "**/archetype-resources/**",
                        "**/META-INF/maven/**"
                    ],
                    "generatesMetadataFilesAtProjectRoot": false
                },
                "maven": {
                    "downloadSources": false,
                    "updateSnapshots": false
                },
                "eclipse": {
                    "downloadSources": false
                },
                "referencesCodeLens": {
                    "enabled": false
                },
                "signatureHelp": {
                    "enabled": true,
                    "description": {
                        "enabled": false
                    }
                },
                "implementationsCodeLens": {
                    "enabled": false
                },
                "implementationCodeLens": "none",
                "format": {
                    "enabled": true,
                    "settings": {
                        "url": null,
                        "profile": null
                    },
                    "comments": {
                        "enabled": true
                    },
                    "onType": {
                        "enabled": true
                    }
                },
                "saveActions": {
                    "organizeImports": false,
                    "cleanup": true
                },
                "project": {
                    "referencedLibraries": [
                        "lib/**/*.jar"
                    ],
                    "importOnFirstTimeStartup": "automatic",
                    "importHint": true,
                    "resourceFilters": [
                        "node_modules",
                        "\\.git"
                    ],
                    "encoding": "ignore"
                },
                "contentProvider": {
                    "preferred": null
                },
                "autobuild": {
                    "enabled": true
                },
                "maxConcurrentBuilds": 1,
                "recommendations": {
                    "dependency": {
                        "analytics": {
                            "show": true
                        }
                    }
                },
                "completion": {
                    "engine": "ecj",
                    "maxResults": 0,
                    "enabled": true,
                    "guessMethodArguments": true,
                    "favoriteStaticMembers": [
                        "org.junit.Assert.*",
                        "org.junit.Assume.*",
                        "org.junit.jupiter.api.Assertions.*",
                        "org.junit.jupiter.api.Assumptions.*",
                        "org.junit.jupiter.api.DynamicContainer.*",
                        "org.junit.jupiter.api.DynamicTest.*",
                        "org.mockito.Mockito.*",
                        "org.mockito.ArgumentMatchers.*",
                        "org.mockito.Answers.*"
                    ],
                    "filteredTypes": [
                        "java.awt.*",
                        "com.sun.*",
                        "sun.*",
                        "jdk.*",
                        "org.graalvm.*",
                        "io.micrometer.shaded.*"
                    ],
                    "importOrder": [
                        "#",
                        "java",
                        "javax",
                        "org",
                        "com",
                        ""
                    ],
                    "postfix": {
                        "enabled": true
                    },
                    "matchCase": "off"
                },
                "foldingRange": {
                    "enabled": true
                },
                "progressReports": {
                    "enabled": true
                },
                "codeGeneration": {
                    "hashCodeEquals": {
                        "useJava7Objects": false,
                        "useInstanceof": false
                    },
                    "useBlocks": false,
                    "generateComments": false,
                    "toString": {
                        "template": "${object.className} [${member.name()}=${member.value}, ${otherMembers}]",
                        "codeStyle": "STRING_CONCATENATION",
                        "skipNullValues": false,
                        "listArrayContents": true,
                        "limitElements": 0
                    },
                    "insertionLocation": "afterCursor"
                },
                "selectionRange": {
                    "enabled": true
                },
                "showBuildStatusOnStart": {
                    "enabled": "notification"
                },
                "server": {
                    "launchMode": "Standard"
                },
                "sources": {
                    "organizeImports": {
                        "starThreshold": 99,
                        "staticStarThreshold": 99
                    }
                },
                "imports": {
                    "gradle": {
                        "wrapper": {
                            "checksums": []
                        }
                    }
                },
                "templates": {
                    "fileHeader": [],
                    "typeComment": []
                },
                "references": {
                    "includeDeclarations": false,
                    "includeAccessors": true,
                    "includeDecompiledSources": true
                },
                "typeHierarchy": {
                    "lazyLoad": false
                },
                "settings": {
                    "url": null
                },
                "symbols": {
                    "includeSourceMethodDeclarations": false
                },
                "quickfix": {
                    "showAt": "line"
                },
                "inlayHints": {
                    "parameterNames": {
                        "enabled": "literals",
                        "exclusions": []
                    }
                },
                "codeAction": {
                    "sortMembers": {
                        "avoidVolatileChanges": true
                    }
                },
                "compile": {
                    "nullAnalysis": {
                        "nonnullbydefault": [
                            "javax.annotation.ParametersAreNonnullByDefault",
                            "org.eclipse.jdt.annotation.NonNullByDefault",
                            "org.springframework.lang.NonNullApi"
                        ],
                        "nonnull": [
                            "javax.annotation.Nonnull",
                            "org.eclipse.jdt.annotation.NonNull",
                            "org.springframework.lang.NonNull"
                        ],
                        "nullable": [
                            "javax.annotation.Nullable",
                            "org.eclipse.jdt.annotation.Nullable",
                            "org.springframework.lang.Nullable"
                        ],
                        "mode": "interactive"
                    }
                },
                "cleanup": {
                    "actions": [
                        "renameFileToType"
                    ],
                    "actionsOnSave": []
                },
                "sharedIndexes": {
                    "enabled": "auto",
                    "location": ""
                },
                "refactoring": {
                    "extract": {
                        "interface": {
                            "replace": true
                        }
                    }
                }
            }
        },
        "extendedClientCapabilities": {
            "progressReportProvider": true,
            "classFileContentsSupport": true,
            "overrideMethodsPromptSupport": true,
            "hashCodeEqualsPromptSupport": true,
            "advancedOrganizeImportsSupport": true,
            "generateToStringPromptSupport": true,
            "advancedGenerateAccessorsSupport": true,
            "generateConstructorsPromptSupport": true,
            "generateDelegateMethodsPromptSupport": true,
            "advancedExtractRefactoringSupport": true,
            "inferSelectionSupport": [
                "extractMethod",
                "extractVariable",
                "extractField"
            ],
            "moveRefactoringSupport": true,
            "clientHoverProvider": true,
            "clientDocumentSymbolProvider": true,
            "gradleChecksumWrapperPromptSupport": true,
            "advancedIntroduceParameterRefactoringSupport": true,
            "actionableRuntimeNotificationSupport": true,
            "shouldLanguageServerExitOnShutdown": true,
            "onCompletionItemSelectedCommand": "editor.action.triggerParameterHints",
            "extractInterfaceSupport": true,
            "advancedUpgradeGradleSupport": true,
            "executeClientCommandSupport": true
        },
        "triggerFiles": [
            "file:///c%3A/Users/sheng/Documents/myprojects/java/swagger-demo/src/test/java/org/sqg/AppTest.java"
        ]
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///c%3A/Users/sheng/Documents/myprojects/java/swagger-demo",
            "name": "swagger-demo"
        }
    ],
    "locale": "zh_CN",
    "clientInfo": {
        "name": "coc.nvim",
        "version": "0.0.82"
    }
}

log from :CocInfo command

## versions

vim version: VIM - Vi IMproved 9.1 9010821
node version: v22.17.1
coc.nvim version: 0.0.82-29774cf 2025-07-21 11:21:14 +0800
coc.nvim directory: C:\Users\sheng\vimfiles\plugged\coc.nvim
term: undefined
platform: win32

## Log of coc.nvim

2025-08-23T03:38:08.780 INFO (pid:17108) [plugin] - coc.nvim initialized with node: v22.17.1 after 185
2025-08-23T03:38:09.134 INFO (pid:17108) [attach] - receive notification: highlight []
2025-08-23T03:38:11.921 INFO (pid:17108) [attach] - receive notification: highlight []
2025-08-23T03:38:12.941 INFO (pid:17108) [attach] - receive notification: highlight []
2025-08-23T03:38:13.559 INFO (pid:17108) [services] - LanguageClient Language Support for Java state change: stopped => starting
2025-08-23T03:38:13.569 INFO (pid:17108) [language-client-index] - Language server "java" started with 6300
2025-08-23T03:38:13.714 INFO (pid:17108) [attach] - receive notification: highlight []
2025-08-23T03:38:14.171 INFO (pid:17108) [attach] - receive notification: highlight []
2025-08-23T03:38:17.480 INFO (pid:17108) [attach] - receive notification: highlight []
2025-08-23T03:38:20.844 INFO (pid:17108) [attach] - receive notification: runCommand [ 'java.open.logs' ]

according to the behavior, it seems like nodejs has lose communication channel to the the spawn process while it can be interactive with user input in the terminal window. if coc-java is forced to use another jdk other than the automatically downloaded one in coc directory, the familiar EPIPE failure shows up

    "java.jdt.ls.java.home": "C:\\Program Files\\Microsoft\\jdk-21.0.8.9-hotspot",
Image

shiluotang avatar Aug 22 '25 20:08 shiluotang

The problem in Windows is paths with spaces, since you cannot execute a command for that reason. To do this, you must place the JDK in a path that does not have spaces in its folder names.

Image

jeirf12 avatar Sep 13 '25 01:09 jeirf12