Skip to content

Error in install due to java-debug-adapter jar file version mismatch #104

Closed

Description

@distractedpen

Did you check docs and existing issues?

  • I have read all the plugin docs
  • I have searched the existing issues
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.9.4

Operating system/version

LMDE 6 / MacOs

Describe the bug

Installing this plugin failed due to a version mismatch between the downloaded the version of java-debug-adapter requested to download by nvim-java and the version that mason-registry tries to link.

Version 52 of java-debug-adapter downloaded contains the { name = 'java-debug-adapter', version = '0.52.0' },
        Downloading file "https://open-vsx.org/api/vscjava/vscode-java-debug/0.52.0/file/vscjava.vscode-java-debug-0.52.0.vsix"…
[...ommited unpacking log...]
        Link target "/home/distractedpen/.local/share/nvim/mason/packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-0.50.0.jar" does not exist.

Mason registry updated a few hours ago to java-debug-server version 55 which contains server version 50, version 52.0 of java-debug-adapter contains server version 47.0.

Steps To Reproduce

  1. Update nvim-mason to the latest version (1.9.0)
  2. Fresh install nvim-java

Expected Behavior

java-debug-adapter's server version file should match the version linked to by mason-registry.

Activity

  1. moved this to In Progress in Java for Neovimon Jan 7, 2024
  2. added this to the v2.0.0 milestone on Jan 7, 2024
  3. self-assigned this
    on Jan 7, 2024
  4. VICTORVICKIE commented on Jan 7, 2024

    @VICTORVICKIE

    As mentioned #103 (comment), I am getting this error after mason update.

    Edit:

    Is it possible to make DAP Configurable / Opt In Feature?

  5. s1n7ax commented on Jan 7, 2024

    @s1n7ax
    Member

    @VICTORVICKIE I think there is a workaround.

    • Comment out the main mason-registry.
    registries = {
    	'github:nvim-java/mason-registry',
    	-- 'github:mason-org/mason-registry',
    },
    • Let it install all the dependencies
    • Then uncomment the mason-registry

    I think this should be a workaround

  6. VICTORVICKIE commented on Jan 7, 2024

    @VICTORVICKIE

    @VICTORVICKIE I think there is a workaround.

    • Comment out the main mason-registry.
    registries = {
    	'github:nvim-java/mason-registry',
    	-- 'github:mason-org/mason-registry',
    },
    • Let it install all the dependencies
    • Then uncomment the mason-registry

    I think this should be a workaround

    This doesnt work either, once i uncomment, it still tries to download and mason window pops every time i launch nvim

  7. s1n7ax commented on Jan 7, 2024

    @s1n7ax
    Member

    @VICTORVICKIE my bad. I thought java-debug coming from nvim-java reg. You will have to wait till this is fixed from my end.

  8. VICTORVICKIE commented on Jan 7, 2024

    @VICTORVICKIE

    @VICTORVICKIE my bad. I thought java-debug coming from nvim-java reg. You will have to wait till this is fixed from my end.

    ok, also can you make it so we can opt out of nvim-java-dap?
    since this won't break existing configurations?

    or we can do that already?

  9. s1n7ax commented on Jan 7, 2024

    @s1n7ax
    Member
  10. s1n7ax commented on Jan 7, 2024

    @s1n7ax
    Member

    @distractedpen thanks for reporting immediately

  11. s1n7ax commented on Jan 7, 2024

    @s1n7ax
    Member

    Cause of this issue is tracked here to find solutions in the future
    Java for Neovim (view)

  12. moved this from In Progress to Done in Java for Neovimon Mar 24, 2024
  13. glennmca-dev commented on Dec 21, 2024

    @glennmca-dev

    Has there been any progress on this?
    I'm getting a similar issue, even with this in my config:

        local servers = {
            -- clangd = {},
            gopls = {},
            pyright = {},
            angularls = {},
            bashls = {},
            dockerls = {},
            docker_compose_language_service = {},
            groovyls = {},
            jdtls = {
              settings = {
                java = {
                  configuration = {
                    runtimes = {
                      {
                        name = 'ASDF Java',
                        path = '~/.asdf/shims/java',
                        default = true,
                      },
                    },
                  },
                },
              },
            },
            jsonls = {},
            markdown_oxide = {},
            terraformls = {},
            ts_ls = {},
            yamlls = {},
        },
    ...
    ...
    ...
          require('java').setup {
            -- load java debugger plugins
            java_debug_adapter = {
              enable = false,
            },
          }

    java_debug_adapter tries to install with mason every time i start nvim and fails with this error:

    Failed
        ◍ java-debug-adapter
          ▼ Displaying full log
            Downloading file "https://open-vsx.org/api/vscjava/vscode-java-debug/0.58.0/file/vscjava.vscode-java-debug-0.58.0.vsix"…
            Unpacking "vscjava.vscode-java-debug-0.58.0.vsix"…
            Archive:  vscjava.vscode-java-debug-0.58.0.vsix
              inflating: ./extension.vsixmanifest  
              inflating: ./[Content_Types].xml   
              inflating: ./extension/CHANGELOG.md  
              inflating: ./extension/Configuration.md  
              inflating: ./extension/dist/extension.js  
              inflating: ./extension/dist/extension.js.LICENSE.txt  
              inflating: ./extension/images/commands/hot_code_replace.svg  
              inflating: ./extension/LICENSE.txt  
              inflating: ./extension/logo.png    
              inflating: ./extension/package.json  
              inflating: ./extension/package.nls.es.json  
              inflating: ./extension/package.nls.it.json  
              inflating: ./extension/package.nls.json  
              inflating: ./extension/package.nls.zh-cn.json  
              inflating: ./extension/package.nls.zh-tw.json  
              inflating: ./extension/README.md   
              inflating: ./extension/SECURITY.md  
              inflating: ./extension/server/com.microsoft.java.debug.plugin-0.53.0.jar  
              inflating: ./extension/ThirdPartyNotices.txt  
              inflating: ./extension/Troubleshooting_encoding.md  
              inflating: ./extension/Troubleshooting.md  
            Link target "/home/glenn/.local/share/nvim/mason/packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-0.53.1.jar" does not exist.
    

    system info:

    • linux mint 22
    • neovim v: 10.2
    • zsh
  14. glennmca-dev commented on Dec 21, 2024

    @glennmca-dev

    Sorry for necrothreading, i can open a new issue if needed.

  15. s1n7ax commented on Dec 21, 2024

    @s1n7ax
    Member

    @glennmca-dev what versions of jdtls and java-debug-adapter causing this error?

  16. glennmca-dev commented on Dec 21, 2024

    @glennmca-dev

    Hi @s1n7ax,
    I haven't pinned certain versions of either of these in my config, and the commit hash does not make it into my lazy lock file because the dependency (java-debug-adapter) fails to install

  17. s1n7ax commented on Dec 21, 2024

    @s1n7ax
    Member

    @glennmca-dev What are the currently installed versions of jdtls and java-debug-adapter?

  18. s1n7ax commented on Dec 22, 2024

    @s1n7ax
    Member

    @glennmca-dev java-debug-adapter & jdtls is not installed through Lazy so there is no commit hash. It's using mason. You should see the version it's trying to install if it fails

  19. olrtg commented on Dec 22, 2024

    @olrtg

    Hey @s1n7ax for me is failing like this:

      Failed
        ◍ java-debug-adapter
          ▶ # [26/26] Link target "/Users/olrtg/.local/share/nvim/mason/packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-0.53.1.jar" does not exist.
    

    If you need more info let me know! I don't do much java development so is annoying getting the Mason popup on every start.

  20. glennmca-dev commented on Dec 22, 2024

    @glennmca-dev

    @glennmca-dev java-debug-adapter & jdtls is not installed through Lazy so there is no commit hash. It's using mason. You should see the version it's trying to install if it fails

    @s1n7ax Apologies, i'll copy the info below:

    jdtls:

        ◍ jdtls
          Java language server.
    
          installed version v1.37.0                                   
          homepage          https://github.com/eclipse/eclipse.jdt.ls 
          languages         Java                                      
          categories        LSP                                       
          executables       jdtls                                     
    

    java_debug_adapter (failing to install) the log i pasted above shows the output when it fails, if i press i inside mason, it does install, with the following version, but when i quit and re-enter nvim, it opens the mason window and fails again:

        ◍ java-debug-adapter
          The debug server implementation for Java. It conforms to the debugger adapter protocol.
    
          installed version 0.58.1                                  
          homepage          https://github.com/microsoft/java-debug 
          languages         Java                                    
          categories        DAP                                     
    
  21. glennmca-dev commented on Dec 23, 2024

    @glennmca-dev

    i seem to have fixed it by changing the version pinned in ~/.local/share/nvim/lazy/nvim-java/lua/java/startup/mason-dep.lua to 0.58.1

  22. chetra-seng commented on Dec 23, 2024

    @chetra-seng

    @glennmca-dev Dude, you saved the day

  23. glennmca-dev commented on Dec 23, 2024

    @glennmca-dev

    @chetra-seng Yeah it made the experience better for me lol, at least mason doesn't show up every time i open nvim now. I'm not a maintainer so i don't know how well that version will play with the rest of the pinned versions, but considering its just a patch version bump, i don't see any reason why it wouldn't work, there shouldn't be any breaking changes.
    @s1n7ax is there a reason we pin versions? how come we don't just use latest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions