Install java complete in ubuntu vim
In Linux, there is no lightweight JavaIDE similar to JCreateor. Although there are many imperfections in vim's combination with javacomplete, it can solve the problem of java code completion to a certain extent.
Installation Process:
Download javacomplete: Omni Completion for JAVA
Download address on the official website
There are two folders, one is autoload and the other is doc.
Copy the contents of the two folders~ /. Vim /*In the corresponding folder.
There is a Reflecttion. java file in autoload. compile it with javac
Set~ /. Vim/autoloadAdded to the java environment variable.~ /. BashrcCan also be added/Etc/profileMedium
# sun java8u45export JAVA_HOME=/usr/lib/jvm/java-8u45-sun export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:~/.vim/autoloadexport PATH=${JAVA_HOME}/bin:$PATH
Update bashrc after adding
source ~/.bashrc
Modify vimrc
Add the following sentence:
setlocal omnifunc=javacomplete#Completeautocmd FileType java set omnifunc=javacomplete#Completeautocmd FileType java set completefunc=javacomplete#CompleteParamsInfautocmd FileType java inoremap . .
Now we should be able to complete the system functions ,: