Install javacomplete and vimjavacomplete in ubuntu vim

Source: Internet
Author: User
Tags autoload

Install javacomplete and vimjavacomplete 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 <buffer> . .<C-X><C-O><C-P>

Now we should be able to complete the system functions ,:

For more information, see:
Http://www.cnblogs.com/Nstd/archive/2012/04/14/2447828.html

Http://blog.csdn.net/wangran51/article/details/7248945

Http://blog.csdn.net/jixiuffff/article/details/5695806

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.