I believe I lost many people’s attention during my live coding sessions with Clojure and the Eclipse plugin for Clojure development – counterclockwise as I used to not get the feature Navigate to Definition or just hovering over a symbol with the Cmd key working in Eclipse.
I didn’t care much as Eclipse was an IDE that I didn’t spend much time with while developing applications in Clojure. It was Clojure’s REPL where I spent most of the time. On the other hand, I was asked to show the IDE support for Clojure and Eclipse was presented.
Whenever I hovered over a symbol the error message “You need a running Clojure VM” was shown.
I couldn’t fix it for long time until today.
Have all the dependencies of your Clojure project defined in Eclipse. I use leiningen 2 which used to download the dependencies into lib and lib/dev directories (in the version 1), but it doesn’t anymore so I had to use the pom task which “Writes a pom.xml file to disk for Maven interoperability.” (from lein2 help pom).
Once pom.xml is generated, import the project into Eclipse using Import > Maven > Existing Maven Projects.
After a while, when the compilation is done, from the context menu (under the right mouse button) of the project, select Run As > Clojure Application.
If no problems are encountered, the nREPL view is displayed and symbols are easily resolvable with the feature “Navigate to Definition”. Alternatively, you can use the key F3.
Check it out and report how it works for you.