Counterclockwise and: gen-class

I am using Eclipse (4.2.0) with Counteclockwise (0.10.1.STABLE001). I have a clojure namespace for which I would like to generate a class:

(ns abc (:gen-class :name "abcService")) (-method [] ...) 

There is a defect, but it is designated as fixed, starting with version 0.59 here .

Is there any way I can run or configure this from the IDE without resorting to compiling from the command line?

There is a related question, How to use the compiled clojure class in Eclipse with a counterclockwise but no solution.

+4
source share
2 answers

In Counterclockwise 0.10.1 (the version you are using) there is an easy way to do this: you have to start the launch configuration from the root node context menu (Run as> Clojure Application).

  • When starting from the root of the project, the builder will be configured to let AOT compile the entire project each time the file is saved (and also when starting the launch, sometimes it does not work correctly). This means that your namespace will be compiled by AOT and therefore your gen class.
+1
source

I assume that you are using CCW with leiningen and therefore have a project.clj file:

add similar to project.clj:

 :aot [org.example.sample] 

You may not have a project.clj file if you used CCW to create a project

+1
source

All Articles