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

astrocommunity.pack.java doesn't work for me #179

Closed
theRoboxx opened this issue May 2, 2023 · 9 comments
Closed

astrocommunity.pack.java doesn't work for me #179

theRoboxx opened this issue May 2, 2023 · 9 comments

Comments

@theRoboxx
Copy link

I added { import = "astrocommunity.pack.java" }, to my user/plugins/community.lua file but the language server doesn't seems to work and doesn't show up at the bottom right corner.

I also get this notification from the screenshot.
swappy-20230430_151203

Additionally :set filetype=java doesn't work and shows this notification.
Does anyone know, how to debug this specific error or know the cause for it?

Thanks in advance. ✌️

~/.local/state/nvim/lsp.log prints:

[START][2023-05-01 21:09:37] LSP logging initiated
[ERROR][2023-05-01 21:09:37] .../vim/lsp/rpc.lua:734    "rpc"    "java"    "stderr"    "Error: Unable to access jarfile \n"

:echo $PATH prints:

/home/user_name/.local/share/nvim/mason/bin:/home/user_name/.npm-global/bin:/home/user_name/.local/bi
n:/usr/local/sbin:/usr/local/bin:/usr/bin:/home/user_name/.dotnet/tools:/usr/lib/jvm/defaul
t/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

Here is the output from :checkhealth :

==============================================================================
astronvim: require("astronvim.health").check()

AstroNvim ~
- AstroNvim Version: v3.13.2
- Neovim Version: v0.9.0
- OK Using stable Neovim >= 0.8.0
- OK `git` is installed: Used for core functionality such as updater and plugin management
- OK `xdg-open` is installed: Used for `gx` mapping for opening files with system opener (Optional)
- OK `lazygit` is installed: Used for mappings to pull up git TUI (Optional)
- OK `node` is installed: Used for mappings to pull up node REPL (Optional)
- WARNING `gdu` is not installed: Used for mappings to pull up disk usage analyzer (Optional)
- WARNING `btm` is not installed: Used for mappings to pull up system monitor (Optional)
- OK `python` is installed: Used for mappings to pull up python REPL (Optional)

==============================================================================
lazy: require("lazy.health").check()

lazy.nvim ~
- OK Git installed
- OK no existing packages found by other package managers
- OK packer_compiled.lua not found
- WARNING {package-info.nvim}: unknown key <requires>

==============================================================================
mason: require("mason.health").check()

mason.nvim ~
- OK mason.nvim version v1.0.1
- OK neovim version >= 0.7.0

mason.nvim [Registries] ~
- OK Registry `github.com/mason-org/mason-registry version: 2023-05-01-asian-porgy` is installed.

mason.nvim [Core utils] ~
- OK unzip: `UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send`
- OK wget: `GNU Wget 1.21.3 built on linux-gnu.`
- OK curl: `curl 8.0.1 (x86_64-pc-linux-gnu) libcurl/8.0.1 OpenSSL/3.0.8 zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh2/1.10.0 nghttp2/1.52.0`
- OK gzip: `gzip 1.12`
- OK tar: `tar (GNU tar) 1.34`
- OK bash: `GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)`
- OK sh: `Ok`

mason.nvim [Languages] ~
- WARNING luarocks: not available
  - ADVICE:
    - spawn: luarocks failed with exit code - and signal -. luarocks is not executable
- WARNING Composer: not available
  - ADVICE:
    - spawn: composer failed with exit code - and signal -. composer is not executable
- WARNING PHP: not available
  - ADVICE:
    - spawn: php failed with exit code - and signal -. php is not executable
- OK Go: `go version go1.20.3 linux/amd64`
- OK cargo: `cargo 1.68.2`
- OK Ruby: `ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c5) [x86_64-linux]`
- OK node: `v14.21.3`
- WARNING julia: not available
  - ADVICE:
    - spawn: julia failed with exit code - and signal -. julia is not executable
- OK python3: `Python 3.10.10`
- OK java: `openjdk version "17.0.6" 2023-01-17`
- OK RubyGem: `3.3.25`
- OK javac: `javac 17.0.6`
- OK npm: `8.19.2`
- OK pip3: `pip 23.0.1 from /usr/lib/python3.10/site-packages/pip (python 3.10)`

mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Tue 02 May 2023 02:48:56 AM CEST.
  Install and authenticate via gh-cli to increase rate limit.

==============================================================================
null-ls: require("null-ls.health").check()

- OK prettier: the command "prettier" is executable.
- OK stylua: the command "stylua" is executable.

==============================================================================
nvim: require("nvim.health").check()

Configuration ~
- OK no issues found

Runtime ~
- OK $VIMRUNTIME: /usr/share/nvim/runtime

Performance ~
- OK Build type: Release

Remote Plugins ~
- OK Up to date

terminal ~
- key_backspace (kbs) terminfo entry: `key_backspace=\177`
- key_dc (kdch1) terminfo entry: `key_dc=\E[3~`
- $TERM_PROGRAM="foot"
- $COLORTERM="truecolor"

==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~
- OK `tree-sitter` found 0.20.8 (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v14.21.3 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
  Version: cc (GCC) 12.2.1 20230201
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
  machine = "x86_64",
  release = "5.15.108-1-MANJARO",
  sysname = "Linux",
  version = "#1 SMP PREEMPT Thu Apr 20 11:41:14 UTC 2023"
} ~

Parser/Features         H L F I J
  - lua                 ✓ ✓ ✓ ✓ ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang} ~

==============================================================================
provider: health#provider#check

Clipboard (optional) ~
- OK Clipboard tool found: wl-copy

Python 3 provider (optional) ~
- `g:python3_host_prog` is not set.  Searching for python3 in the environment.
- Executable: /usr/bin/python3
- ERROR Command error (job=5, exit code 1): `'/usr/bin/python3' -c 'import sys; sys.path = [p for p in sys.path if p != ""]; import neovim; print(neovim.__file__)'` (in '/home/user_name')
  stderr: Traceback (most recent call last):  File "<string>", line 1, in <module>  File "/home/user_name/.local/lib/python3.10/site-packages/neovim/__init__.py", line 5, in <module>    import pynvim  File "/home/user_name/.local/lib/python3.10/site-packages/pynvim/__init__.py", line 9, in <module>    from pynvim.api import Nvim, NvimError  File "/home/user_name/.local/lib/python3.10/site-packages/pynvim/api/__init__.py", line 7, in <module>    from pynvim.api.buffer import Buffer  File "/home/user_name/.local/lib/python3.10/site-packages/pynvim/api/buffer.py", line 2, in <module>    from pynvim.api.common import Remote  File "/home/user_name/.local/lib/python3.10/site-packages/pynvim/api/common.py", line 4, in <module>    from msgpack import unpackbModuleNotFoundError: No module named 'msgpack'
- Python version: 3.10.10
- pynvim version: unable to load neovim Python module
- ERROR pynvim is not installed.
  Error: unable to load neovim Python module
  - ADVICE:
    - Run in shell: /usr/bin/python3 -m pip install pynvim

Python virtualenv ~
- OK no $VIRTUAL_ENV

Ruby provider (optional) ~
- Ruby: ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c5) [x86_64-linux]
- WARNING `neovim-ruby-host` not found.
  - ADVICE:
    - Run `gem install neovim` to ensure the neovim RubyGem is installed.
    - Run `gem environment` to ensure the gem bin directory is in $PATH.
    - If you are using rvm/rbenv/chruby, try "rehashing".
    - See :help |g:ruby_host_prog| for non-standard gem installations.
    - You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim

Node.js provider (optional) ~
- Node.js: v14.21.3
- WARNING Missing "neovim" npm (or yarn, pnpm) package.
  - ADVICE:
    - Run in shell: npm install -g neovim
    - Run in shell (if you use yarn): yarn global add neovim
    - Run in shell (if you use pnpm): pnpm install -g neovim
    - You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim

Perl provider (optional) ~
- WARNING "Neovim::Ext" cpan module is not installed
  - ADVICE:
    - See :help |provider-perl| for more information.
    - You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim

==============================================================================
vim.lsp: require("vim.lsp.health").check()

- LSP log level : WARN
- Log path: /home/user_name/.local/state/nvim/lsp.log
- Log size: 375 KB

vim.lsp: Active Clients ~
- null-ls (id=1, root_dir=/home/user_name)

==============================================================================
vim.treesitter: require("vim.treesitter.health").check()

- Nvim runtime ABI version: 14
- OK Parser: lua        ABI: 13, path: /home/user_name/.local/share/nvim/lazy/nvim-treesitter/parser/lua.so

==============================================================================
vimtex: health#vimtex#check

VimTeX ~
- OK Vim version should have full support!
- WARNING biber is not executable!
  - ADVICE:
    - Biber is often required so this may give unexpected problems.
- OK General viewer should work properly!
- OK Compiler should work!

==============================================================================
which-key: require("which-key.health").check()

WhichKey: checking conflicting keymaps ~
- WARNING conflicting keymap exists for mode **"v"**, lhs: **"<leader>l"**
- rhs: ` `
- OK No conflicting keymaps found

@luxus
Copy link
Member

luxus commented May 2, 2023

@sjcobb2022 any idea?

@sjcobb2022
Copy link
Contributor

sjcobb2022 commented May 2, 2023

@sjcobb2022 any idea?

The unable to find jar error makes it seem like mason isn't installing the lombok.jar file that's necessary for jdtls.

@theRoboxx can you send a tree of .local/share/nvim/mason. I think the path should be something like mason/jdtls or mason/java I'm not entirely sure.

Also could you send an list of the directory that you were editing java in.

@theRoboxx
Copy link
Author

@sjcobb2022 any idea?

The unable to find jar error makes it seem like mason isn't installing the lombok.jar file that's necessary for jdtls.

@theRoboxx can you send a tree of .local/share/nvim/mason. I think the path should be something like mason/jdtls or mason/java I'm not entirely sure.

Also could you send an list of the directory that you were editing java in.

tree of .local/share/nvim/mason : https://paste.ccc.ac/?4ecff5e84ba96772#nsvqsC6KGK5uh+EwNqTX/L9OI0HHhTUFVkBmDGZm6Mw=

The path of the .java files are ~/Desktop/projects/p2/src/main/java/de/uni/edu/demo/service/
~/Desktop/projects/p2/src/main/java/de/uni/edu/demo/command/
~/Desktop/projects/p2/src/main/java/de/uni/edu/demo/util/
I also tested and created .java files in the ~ directory.

@sjcobb2022
Copy link
Contributor

@sjcobb2022 any idea?

The unable to find jar error makes it seem like mason isn't installing the lombok.jar file that's necessary for jdtls.
@theRoboxx can you send a tree of .local/share/nvim/mason. I think the path should be something like mason/jdtls or mason/java I'm not entirely sure.
Also could you send an list of the directory that you were editing java in.

tree of .local/share/nvim/mason : https://paste.ccc.ac/?4ecff5e84ba96772#nsvqsC6KGK5uh+EwNqTX/L9OI0HHhTUFVkBmDGZm6Mw=

The path of the .java files are ~/Desktop/projects/p2/src/main/java/de/uni/edu/demo/service/ ~/Desktop/projects/p2/src/main/java/de/uni/edu/demo/command/ ~/Desktop/projects/p2/src/main/java/de/uni/edu/demo/util/ I also tested and created .java files in the ~ directory.

Can you quickly give me a ls of the demo directory?

I think the issue is that you don't have any "markers" in your demo folder. The default markers are here. This is because nvim-jdtls requires a root marker. If you don't have any of the files/folders in your working directory, i don't think jdtls will start up.

@theRoboxx
Copy link
Author

$ ls ~/Desktop/projects/p2/src/main/java/de/uni/edu/demo
App.java  command  service  util

The gradle files are here:

$ ls ~/Desktop/projects/p2
build	     gradle   gradlew.bat  settings.gradle
build.gradle  gradlew    src

Oh, I see. I executed nvim ~/Desktop/projects/p2 from the root of the whole project and opened the .java files via the explorer. Now it seems to work and jdtls starts in the bottom right corner.

@sjcobb2022
Copy link
Contributor

$ ls ~/Desktop/projects/p2/src/main/java/de/uni/edu/demo
App.java  command  service  util

The gradle files are here:

$ ls ~/Desktop/projects/p2
build	     gradle   gradlew.bat  settings.gradle
build.gradle  gradlew    src

Oh, I see. I executed nvim ~/Desktop/projects/p2 from the root of the whole project and opened the .java files via the explorer. Now it seems to work and jdtls starts in the bottom right corner.

Awesome. Maybe we could consider putting a warning in the readme for the java pack

@luxus
Copy link
Member

luxus commented May 2, 2023

this community is wonderful :D

@luxus
Copy link
Member

luxus commented May 2, 2023

if this is resolved please close it.

@Uzaaft
Copy link
Member

Uzaaft commented May 3, 2023

I'm just going to go ahead and close the issue since it seems to have been resolved. Please reopen if the issue still persist.

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

4 participants