Skip to content

bug: mason reinstall jdtls each time open java file #352

Closed

Description

@TayTTo

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)

v0.11.0-dev-1713+g53e737748e

Operating system/version

Debian

Describe the bug

Each time I run nvim, the mason will install jdtls

Steps To Reproduce

1.Open nvim
2.Mason reinstall jdtls everytime

Expected Behavior

Expect hehavior is it not auto reinstall anythine

Activity

  1. s1n7ax commented on Feb 16, 2025

    @s1n7ax
    Member

    @TayTTo Please update the plugin and let me know if the latest version work or not.

  2. TayTTo commented on Feb 16, 2025

    @TayTTo
    Author

    @s1n7ax , hi, I copied your config file at play with nvim-java, the environment that you post for testing this plugin and it works. But some thing weird when I have the following config:

    return {
    	"nvim-java/nvim-java",
    	config = false,
    	ft = {"java"},
    	dependencies = {
    		{
    			"neovim/nvim-lspconfig",
    			opts = {
    				servers = {
    					jdtls = {
    						settings = {
    							java = {
    								configuration = {
    									runtimes = {
    										{
    											name = "JavaSE-23",
    											path = "/usr/local/sdkman/candidates/java/23-tem",
    										},
    									},
    								},
    							},
    						},
    					},
    				},
    				setup = {
    					jdtls = function()
    						require("java").setup({
    							root_markers = {
    								"settings.gradle",
    								"settings.gradle.kts",
    								"pom.xml",
    								"build.gradle",
    								"mvnw",
    								"gradlew",
    								"build.gradle",
    								"build.gradle.kts",
    							},
    						})
    					end,
    				},
    			},
    		},
    	},
    }
    

    The above works whether the following not:

    --return {
    --	'nvim-java/nvim-java',
    --	config = function()
    --		require('java').setup()
    --		require('lspconfig').jdtls.setup({})
    --	end
    --}
    

    but with the no problem config(the obove one that I copy form yours) just have the following command, I have an image below. Does it comefrom I don't have any java config file for my project, because I just want to install a plugin for java so I can learn it, I haven't do java programming for now. I just want nvim can do some Java IDE so I can use it later. More specificly, my code just have one main function for "hello world", and when I copy your config, everything is fine, the java lsp not auto install any more, but the command not work. Does it come from that I don't have any config file or real project now.

    Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions