Here is how I did this recently with following environments
Mac OS Mojave 10.14.3
Vim 8.1.300
Python 3.7
Java version 1.8.0_40
$vim --version | grep python
+comments +libcall -python +viminfo
+conceal +linebreak +python3 +vreplace
Installed ycm
with Vundle
using Plugin 'Valloric/YouCompleteMe'
and then running :PluginInstall
The plugins in downloaded to ~/.vim/bundle/YouCompleteMe
$cd ~/.vim/bundle/YouCompleteMe
$python3 installer.py --java-completer
This creates appropriate files under /.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/eclipse.jdt.ls
(make sure these and inner directories are not owned by root unless you always work as a root)
now open vim and execute :YcmRestartServer
You should be good to go.
Try :YcmDebugInfo
to check if everything is fine
Printing YouCompleteMe debug information...
-- Client logfile: /var/folders/t4/y8zpydv91sv2dszlb1_3qw_r0000gn/T/ycm_1xgp1ub9.log
-- Server Python interpreter: /usr/local/bin/python
-- Server Python version: 3.7.0
-- Server has Clang support compiled in: False
-- Clang version: None
-- Extra configuration file found but not loaded
-- Extra configuration path: ~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py
-- Server running at: http://127.0.0.1:58050
-- Server process ID: 2334
-- Server logfiles:
-- /var/folders/t4/y8zpydv91sv2dszlb1_3qw_r0000gn/T/ycmd_58050_stdout_wzk9oksu.log
-- /var/folders/t4/y8zpydv91sv2dszlb1_3qw_r0000gn/T/ycmd_58050_stderr_xjb7zjn2.log
CentOS Linux release 7.6.1810 (Core)
Vim 8.1.1362
Python 3.7.3
Java openjdk version "1.8.0_191"
Overall process remains same, but I had couple of difficulties on Centos
- Vim was not compiled with Python support
sudo vi /etc/ld.so.conf
added /usr/local/lib
to it which had libpython3.7m.so.1.0
file
sudo ldconfig
git clone https://github.com/vim/vim.git
cd vim
./configure --prefix=/usr/local/ --enable-python3interp=yes --with-python3-command=/usr/local/bin/python --with-python3-config-dir=
Rest of the procedure remains the same.