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

module 'jdtls' not found when using nvim-java #8

Open
PiotrRaszkowski opened this issue Oct 14, 2024 · 1 comment
Open

module 'jdtls' not found when using nvim-java #8

PiotrRaszkowski opened this issue Oct 14, 2024 · 1 comment

Comments

@PiotrRaszkowski
Copy link

I found this issue when trying to use the plugin with nvim-java

Failed to run `config` for springboot-nvim
                                                                                                                                                                                                                                                                                                                            
...e/nvim/lazy/springboot-nvim/lua/springboot-nvim/init.lua:6: module 'jdtls' not found:                                                                                                                                                                                                                                    
^Ino field package.preload['jdtls']                                                                                                                                                                                                                                                                                         
cache_loader: module jdtls not found                                                                                                                                                                                                                                                                                        
cache_loader_lib: module jdtls not found                                                                                                                                                                                                                                                                                    
^Ino file './jdtls.lua'                                                                                                                                                                                                                                                                                                     
^Ino file '/opt/homebrew/share/luajit-2.1/jdtls.lua'                                                                                                                                                                                                                                                                        
^Ino file '/usr/local/share/lua/5.1/jdtls.lua'                                                                                                                                                                                                                                                                              
^Ino file '/usr/local/share/lua/5.1/jdtls/init.lua'                                                                                                                                                                                                                                                                         
^Ino file '/opt/homebrew/share/lua/5.1/jdtls.lua'                                                                                                                                                                                                                                                                           
^Ino file '/opt/homebrew/share/lua/5.1/jdtls/init.lua'                                                                                                                                                                                                                                                                      
^Ino file '/Users/piotr/.local/share/nvim/lazy-rocks/telescope.nvim/share/lua/5.1/jdtls.lua'                                                                                                                                                                                                                                
^Ino file '/Users/piotr/.local/share/nvim/lazy-rocks/telescope.nvim/share/lua/5.1/jdtls/init.lua'                                                                                                                                                                                                                           
^Ino file './jdtls.so'                                                                                                                                                                                                                                                                                                      
^Ino file '/usr/local/lib/lua/5.1/jdtls.so'                                                                                                                                                                                                                                                                                 
^Ino file '/opt/homebrew/lib/lua/5.1/jdtls.so'                                                                                                                                                                                                                                                                              
^Ino file '/usr/local/lib/lua/5.1/loadall.so'                                                                                                                                                                                                                                                                               
^Ino file '/Users/piotr/.local/share/nvim/lazy-rocks/telescope.nvim/lib/lua/5.1/jdtls.so'                                                                                                                                                                                                                                   
^Ino file '/Users/piotr/.local/share/nvim/lazy-rocks/telescope.nvim/lib64/lua/5.1/jdtls.so'        

I think it is because of this local declaration in init.lua:

local jdtls = require("jdtls")

My plugin configuration:

{
        "elmcgill/springboot-nvim",
        dev = true,
        dependencies = {
            "neovim/nvim-lspconfig",
            "nvim-java/nvim-java",
        },
        event = "VeryLazy",
        config = function()
            -- gain acces to the springboot nvim plugin and its functions
            local springboot_nvim = require("springboot-nvim")

            -- set a vim motion to <Space> + <Shift>J + r to run the spring boot project in a vim terminal
            vim.keymap.set("n", "<leader>Jr", springboot_nvim.boot_run, { desc = "[J]ava [R]un Spring Boot" })
            -- set a vim motion to <Space> + <Shift>J + c to open the generate class ui to create a class
            vim.keymap.set("n", "<leader>Jc", springboot_nvim.generate_class, { desc = "[J]ava Create [C]lass" })
            -- set a vim motion to <Space> + <Shift>J + i to open the generate interface ui to create an interface
            vim.keymap.set(
                "n",
                "<leader>Ji",
                springboot_nvim.generate_interface,
                { desc = "[J]ava Create [I]nterface" }
            )
            -- set a vim motion to <Space> + <Shift>J + e to open the generate enum ui to create an enum
            vim.keymap.set("n", "<leader>Je", springboot_nvim.generate_enum, { desc = "[J]ava Create [E]num" })

            -- run the setup function with default configuration
            springboot_nvim.setup({})
        end,
    },

Expected:

  • possibility to use the plugin with nvim-java
@PiotrRaszkowski
Copy link
Author

I think in nvim-java it should be:

local jdtls = require('java.utils.jdtls')

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

1 participant