Skip to content

bug: Install Error nvim-java mason registry is not added correctly! #240

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

Closed
3 tasks done
ShenFeng312 opened this issue Jul 8, 2024 · 10 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@ShenFeng312
Copy link

ShenFeng312 commented Jul 8, 2024

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.9.5

Operating system/version

Ubuntu 24.04

Describe the bug

Error detected while processing /home/shenfeng/.config/nvim/init.lua:
nvim-java mason registry is not added correctly!
This occurs when mason.nvim configured incorrectly
Please refer the link below to fix the issue
https://github.com/nvim-java/nvim-java/wiki/Q-&-A#no_entry-cannot-find-package-xxxxx

Steps To Reproduce

install nvim-java

Expected Behavior

install success

@ShenFeng312 ShenFeng312 added the bug Something isn't working label Jul 8, 2024
@s1n7ax
Copy link
Member

s1n7ax commented Jul 8, 2024

Guide in the link didn't help?

@ShenFeng312
Copy link
Author

ShenFeng312 commented Jul 8, 2024

Guide in the link didn't help?

@s1n7ax I tried using the methods from the link to resolve the issue, but it didn't work.

@s1n7ax
Copy link
Member

s1n7ax commented Jul 8, 2024

What have you tried?

@ShenFeng312
Copy link
Author

I think it's an issue with Mason.nvim, so I tried the three methods mentioned in Cannot find package "xxxxx",' but the problem still persists.

@s1n7ax
Copy link
Member

s1n7ax commented Jul 9, 2024

@ShenFeng312 I know, I'm asking what changes did you do in the code.

@ShenFeng312
Copy link
Author

ShenFeng312 commented Jul 9, 2024

@s1n7ax I didn't make any other changes.

this is my plugins dir

shenfeng@shenfeng:~/.config/nvim/lua/plugins$ ls -al
总计 28
drwxrwxr-x 2 shenfeng shenfeng 4096  7月  8 17:34 .
drwxrwxr-x 4 shenfeng shenfeng 4096  7月  8 13:38 ..
-rw-rw-r-- 1 shenfeng shenfeng  548  7月  8 15:18 barbar.lua
-rw-rw-r-- 1 shenfeng shenfeng   31  7月  8 17:04 java.lua
-rw-rw-r-- 1 shenfeng shenfeng  428  7月  8 17:34 mason.lua
-rw-rw-r-- 1 shenfeng shenfeng  195  7月  8 13:30 nvim.tree.lua
-rw-rw-r-- 1 shenfeng shenfeng   86  7月  8 15:04 tokyonight.lua

this is my config in mason.lua

return {
	'williamboman/mason.nvim',
	opts = {
		ui = {
			icons = {
				package_installed = '',
				package_pending = '',
				package_uninstalled = '',
			},
		},
	},
	-- use OPTS property to pass the configuration
	-- lazy vim call the setup function for you

	-- config = function()
	-- 	require('mason').setup({})
	-- end
	-- ^^^^^^^^^^^^^^^^ DON'T DO THIS
}

this is my config in java.lua

return {'nvim-java/nvim-java'}

and this is my config in init.lua

require("config.lazy")

local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }

-- Move to previous/next
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
-- Re-order to previous/next
map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts)
map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts)
-- Goto buffer in position...
map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts)
map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts)
map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts)
map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts)
map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts)
map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts)
map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts)
map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts)
map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts)
map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts)
-- Pin/unpin buffer
map('n', '<A-p>', '<Cmd>BufferPin<CR>', opts)
-- Close buffer
map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts)
-- Wipeout buffer
--                 :BufferWipeout
-- Close commands
--                 :BufferCloseAllButCurrent
--                 :BufferCloseAllButPinned
--                 :BufferCloseAllButCurrentOrPinned
--                 :BufferCloseBuffersLeft
--                 :BufferCloseBuffersRight
-- Magic buffer-picking mode
map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts)
-- Sort automatically by...
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
map('n', '<Space>bn', '<Cmd>BufferOrderByName<CR>', opts)
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)
map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts)
map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
require('java').setup()


require('lspconfig').jdtls.setup({})

vim.cmd('colorscheme tokyonight')

@s1n7ax
Copy link
Member

s1n7ax commented Jul 9, 2024

That's weird. Do you have your config on github?

@ShenFeng312
Copy link
Author

ShenFeng312 commented Jul 9, 2024

Here~Thank you very much for your help https://github.com/ShenFeng312/nvim-config @s1n7ax

@s1n7ax
Copy link
Member

s1n7ax commented Jul 9, 2024

@ShenFeng312 It works fine. Probably you are using an older lazy.nvim version. Try updating all the plugins. Version must be 11.9.2 right now

@ShenFeng312
Copy link
Author

ShenFeng312 commented Jul 11, 2024

@s1n7ax Thank you, I found the reason. I think we need to add a note in the documentation to inform users to run :MasonUpdate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants