Fork me on GitHub

Download / Install

Requirements

Before beginning the installation, first confirm that you have met the following requirements.

  • Java Development Kit 11 or greater

  • Vim 7.1 or greater

  • Eclipse 4.21 (2021-09)

  • python 3.x

  • make

  • gcc

    Minimum Vim Settings: In order for eclim to function properly, there is a minimum set of vim options that must be enabled in your vimrc file (:h vimrc).

    • set nocompatible

      Execute :h ‘compatible’ for more info. You can confirm that compatibliity is turned off by executing the following in vim:

      :echo &compatible
      

      Which should output ‘0’, but if not, then add the following to your ~/.vimrc files:

      set nocompatible
      
    • filetype plugin on

      Execute :h filetype-plugin-on for more info. You can confirm that file type plugins are enabled by executing the following:

      :filetype
      

      Which should output ‘filetype detection:ON plugin:ON indent:ON’, showing at least ‘ON’ for ‘detection’ and ‘plugin’, but if not, then update your ~/.vimrc to include:

      filetype plugin indent on
      

Download

You can find the official eclim installer on eclim’s github releases page:

Installing / Upgrading

Eclim can be installed a few different ways depending on your preference and environment:

Interactive Command Line Installer

Step 1: Run the installer

Note

If you have eclipse running, please close it prior to starting the installation procedure.

  • First download the installer: eclim_2.21.0.bin

  • Next run the installer:

    $ ./eclim_2.21.0.bin
    

    After the installer starts up, simply follow the steps to install eclim.

    If your machine is behind a proxy, take a look at the instructions for running the installer behind a proxy.

    Note

    For some versions of eclipse you may see some SLF4J output like so during the install, which can be safely ignored:

    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    

Step 2: Test the installation

To test eclim you first need to start the eclim daemon. How you start the daemon will depend on how you intend to use eclim.

Note

More info on running the eclim daemon can be found in the eclimd docs.

If you plan on using eclim along with the eclipse gui, then simply start eclipse and open the eclimd view:

Window ‣ Show View ‣ Other ‣ Eclim ‣ eclimd

If you plan on using eclim without the eclipse gui, then:

  • start the eclimd server.

    To start eclimd, simply execute the eclimd script found in your eclipse root directory (or the path specified at the end of the command line installer):

    $ $ECLIPSE_HOME/eclimd
    

Once you have the eclim daemon (headed or headless) running, you can then test eclim:

  • open a vim window and issue the command, :PingEclim. The result of executing this command should be the eclim and eclipse version echoed to the bottom of your Vim window. If however, you receive unable to connect to eclimd - connect: Connection refused, or something similar, then your eclimd server is not running or something is preventing eclim from connecting to it. If you receive this or any other errors you can start by first examining the eclimd output to see if it gives any info as to what went wrong. If at this point you are unsure how to proceed you can view the troubleshooting guide or feel free to post your issue on the eclim-user mailing list.

    Example of a successful ping:

    _images/ping_success.png

    Example of a failed ping:

    _images/ping_failed.png
  • Regardless of the ping result, you can also verify your vim settings using the command :EclimValidate. This will check various settings and options and report any problems. If all is ok you will receive the following message:

    Result: OK, required settings are valid.
    

Running The Installer Behind a Proxy

If you are behind a proxy, you may need to run the installer like so (be sure to take a look at the related faq as well):

$ ./eclim_2.21.0.bin --proxy my.proxy:8080

If your proxy requires authentication, you’ll need to supply the username and password as well:

$ ./eclim_2.21.0.bin --proxy myuser:mypass@my.proxy:8080

Unattended (automated) install

The eclim installer supports the ability to run an automated install without prompting the user for any input, as long as you supply all the necessary input it requires.

Simply run the installer as shown below, supplying the location of your eclipse install, vim files location, and the plugins you wish to install:

$ ./eclim_2.21.0.bin \
  --yes \
  --eclipse=/opt/eclipse \
  --vimfiles=$HOME/.vim \
  --plugins=jdt,pydev

Building from source

1. Check out the code:

$ git clone git://github.com/ervandew/eclim.git

2. Build eclim:

$ cd eclim
$ ant -Declipse.home=/your/eclipse/home/dir

This will build and deploy eclim to your eclipse and vim directories.

Warning

Building eclim as root is highly discouraged. If your eclipse install is only writable as root, you can supply the eclipse.local property to tell eclim where your eclipse user local directory is located and eclimd will be installed there (make sure to replace <version> portion of the path below accordingly):

$ ant \
    -Declipse.home=/opt/eclipse \
    -Declipse.local=$HOME/.eclipse/org.eclipse.platform_<version>

If you do not yet have a .eclipse directory in your home directory, you can run either of the following commands to create it:

$ ant -Declipse.home=/opt/eclipse eclipse.init

or

$ /path/to/eclipse/eclipse -initialize

Note

If your eclipse home path contains a space, be sure to quote it:

> ant "-Declipse.home=C:/Program Files/eclipse"

Note

If your vimfiles directory is not located at the default location for your OS, then you can specify the location using the “vim.files” property:

$ ant -Dvim.files=<your vimfiles dir>

When the build starts, it will first examine your eclipse installation to find what eclipse plugins are available. It will then use that list to determine which eclim features/plugins should be built and will output a list like the one below showing what will be built vs what will be skipped:

[echo] ${eclipse}: /opt/eclipse
[echo] # Skipping org.eclim.pydev, missing org.eclipse.dltk.core
[echo] Plugins:
[echo]   org.eclim.jdt
[echo]   org.eclim.wst

In this case we can see that four eclim plugins will be skipped along with the eclipse feature that would be required to build those plugins.

If you don’t want to supply the eclipse home directory, or any other properties, on the command line every time you build eclim, you can create a user.properties file at the eclim source root and put all your properties in there:

$ vim user.properties
eclipse.home=/opt/eclipse
eclipse.local=${user.home}/.eclipse/org.eclipse.platform_<version>
vim.files=${user.home}/.vim/bundle/eclim

Note

The eclim vim help files, used by the :EclimHelp command, are not built by default. To build these you first need to install sphinx, then run the following command:

$ ant vimdocs

This target also supports the vim.files property if you want the docs deployed to a directory other than the default location.

Warning

Debian/Ubuntu users: The debian version of sphinx has unfortunately been patched to behave differently than the upstream version, resulting in one or more eclim supplied sphinx extensions not loading. Another issue you may run into is the docutils package, which sphinx depends on, is outdated on debian/ubuntu, resulting in another set of errors.

So to get around these issues you’ll need to install sphinx using pip or similar.

Installing on a headless server

The eclim daemon supports running both inside of the eclipse gui and as a “headless” non-gui server. However, even in the headless mode, eclipse still requires a running X server to function. If you are running eclim on a desktop then this isn’t a problem, but some users would like to run the eclim daemon on a truly headless server. To achieve this, you can make use of X.Org’s Xvfb server.

Note

This guide uses the Ubuntu server distribution to illustrate the process of setting up a headless server, but you should be able to run Xvfb on the distro of your choice by translating the package names used here to your distro’s equivalents.

The first step is to install the packages that are required to run eclipse and eclim:

  • Install a java jdk, xvfb, and the necessary build tools to compile eclim’s nailgun client during installation (make, gcc, etc).

    $ sudo apt-get install openjdk-6-jdk xvfb build-essential
    

Then you’ll need to install eclipse. You may do so by installing it from your distro’s package manager or using a version found on eclipse.org. If you choose to install a version from you package manager, make sure that the version to be installed is compatible with eclim since the package manager version can often be out of date. If you choose to install an eclipse.org version, you can do so by first downloading eclipse using either a console based browser like elinks, or you can navigate to the download page on your desktop and copy the download url and use wget to download the eclipse archive. Once downloaded, you can then extract the archive in the directory of your choice.

Note

When downloading an eclipse distribution, make sure you download one of their archives vs the eclipse installer. An archive can simply be extracted to install eclipse, but the eclipse installer (their default download) may require a gui to install.

$ wget <eclipse_mirror>/eclipse-<version>-linux-gtk.tar.gz
$ tar -zxf eclipse-<version>-linux-gtk.tar.gz

Once eclipse is installed, you can then install eclim normally:

$ ./eclim_2.21.0.bin

The last step is to start Xvfb followed by eclimd:

$ Xvfb :1 -screen 0 1024x768x24 &
$ DISPLAY=:1 ./eclipse/eclimd -b

When starting Xvfb you may receive some errors regarding font paths and possibly dbus and hal, but as long as Xvfb continues to run, you should be able to ignore these errors.

The first time you start eclimd you may want to omit the ‘-b’ argument so that you can see the output on the console to ensure that eclimd starts correctly.

Note

When starting the eclim daemon, you must start it as the same user who will be running vim.

Upgrading

The upgrading procedure is the same as the installation procedure but please be aware that the installer will remove the previous version of eclim prior to installing the new one. The installer will delete all the org.eclim* eclipse plugins along with all the files eclim adds to your .vim or vimfiles directory (plugin/eclim.vim, eclim/**/*).

Uninstall

To uninstall eclim you can use the eclim installer like so:

$ ./eclim_2.21.0.bin uninstall

Unattended (automated) uninstall

Like the installer, the uninstaller also supports an unattended uninstall. You just need to supply your eclipse and vim files directories:

$ ./eclim_2.21.0.bin
  --eclipse=/opt/eclipse \
  --vimfiles=$HOME/.vim \
  uninstall