(I know this is related to How to embed Clojure in an RCP application , but this thread is old and my setup is slightly different)
I am using Eclipse 3.7.1 and have been trying to write an Eclipse / RCP application in Clojure for several days now (as far as possible). I tried to create the original version of clojure.osgi and CCW , tried the RCPClojure demo project and a few other things. Each of them did not work (basically, apparently, “uncommitted” assembly / classpath errors, lack of relevant documents / answers, version conflicts, etc.)
My own steps to bring me at least 50% success:
Create a new plugin project that completes the java file of the Clojure 1.3.0 file, set the plugin ID org.clojure.v1.3.0
Create a New Plugin Project org.cljtest42Using the RCP Welcome Template
- Adding
org.clojurePlugin Dependencies - Adding the character of the CCW project (to enable AOT compilation), this step adds the folder
/classes - Edit
plugin.xmlto add the folder /classesto the path to the runtime, also add org.cljtest42to the exported packages.
Add two simple Clojure files to the package / namespace org.cljtest42:
TestClass.clj:
(ns org.cljtest42.TestClass
(:gen-class))
(defn -main [greet] (println greet))
compile.clj
(ns org.cljtest42.compile)
(dorun (map compile ['org.cljtest42.TestClass]))
Build the AOT trigger by selecting the node project and choose Run> Clojure application (now the folder /classesshould be filled with compiled Clojure classes).
TestClass Activator (, start() - Perspective.createInitialLayout())
. Eclipse :
java.io.FileNotFoundException: Could not locate org/cljtest42/TestClass__init.class or org/cljtest42/TestClass.clj on classpath:
at clojure.lang.RT.load(RT.java:430)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.lang.Var.invoke(Var.java:401)
at com.pspctclr.cljtest42.TestClass.<clinit>(Unknown Source)
, - , . , - , AOT ( , ?,/ ) Clojure - , Equinox/OSGI ?
!