artur-shaik / vim-javacomplete2

DEPRECATED in favor of jc.nvim
Vim License
974 stars 83 forks source link

Argument list too long - Can't start the server #423

Closed NassimBounouas closed 2 years ago

NassimBounouas commented 5 years ago

Hi !

I just installed vim-javacomplete2 on my arch linux laptop and configured my .vimrc but I encounter a problem. I searched on issues but I didn't find anything related to this error. It seems that the problem is coming from python.

Is the anyone who has any idea of the problem source ? screen

Environment

Thank you for your help !

artur-shaik commented 5 years ago

Hi. Can you show logs of server startup?

You need to run:

NassimBounouas commented 5 years ago

Hi Artur,

Firstly thank you for your help. I executed your commands and I found something interesting.

44.104162 [util] running command: 'java -cp /home/user/.vim/bundle/vim-javacomplete2/libs/javavi/target/classes:/home/user/.vim/bundle/vim-javacomplete2/libs/javaparser-core-3.5.20.jar:/home/user/.vim/bundle/vim-javacomplete2/libs/javavi_log4j-api.jar:/home/user/.vim/bundle/vim-javacomplete2/libs/javavi_log4j-core.jar: kg.ash.javavi.Javavi -version'

44.105058 [server] executing python file: /home/user/.vim/bundle/vim-javacomplete2/autoload/javavibridge.py

52.455463 [server] server classpath: -cp /home/user/.vim/bundle/vim-javacomplete2/libs/javavi/target/classes:/home/user/.vim/bundle/vim-javacomplete2/libs/javaparser-core-3.5.20.jar:/home/user/.vim/bundle/vim-javacomplete2/libs/javavi_log4j-api.jar:/home/user/.vim/bundle/vim-javacomplete2/libs/javavi_log4j-core.jar:[very_long_classpath]

52.455851 [server] server arguments:-Ddaemon.port=56047 -Dlog4j.configurationFile=/home/user/.vim/bundle/vim-javacomplete2/libs/javavi/target/classes/log4j2.xml kg.ash.javavi.Javavi -sources [very_long_classpath]

I reduced the trace using [very_long_classpath] because it's unreadable and this classpath contains ALL the projects on my computer. I'll verify my environment variables.

artur-shaik commented 5 years ago

Do you have build system in your project? Seems like jc couldn't find right root directory of your project.

NassimBounouas commented 5 years ago

I think I found the root cause. The problem occurs when I'm trying to edit a simple Java file outside of a project. In this case the plugin is adding every jar file in the folder tree !

@artur-shaik I was writing my answer when I saw yours ! It's exactly the problem, I tried the plugin on a classic maven project and it works.

artur-shaik commented 5 years ago

I think we should consider this case. Thanks for issue. Let it be open until I find solution.

NassimBounouas commented 5 years ago

Yes It could be interesting to consider this case.

I found the hint while reading those files : here and here.

Thank you !

artur-shaik commented 2 years ago

Consider switch to jc.nvim