Fork me on GitHub

@cfleming The problem I am having is that IntelliJ does not see the Clojure code from the Java code. I imagine this is some sort of compilation or classpath issue? Gradle build works, running the built JAR works, only development in IntelliJ has the issue.


@kentoj How are you referencing the Clojure code from the Java code?


Do you mean that when compiling within IntelliJ, that you get compilation errors that you don’t get when using Gradle?


Weird, it is working for me now.


I am referencing it as an import like so: import com.example.core;


With later core.testPrintln("Hello");


Oh, and com.example.core is a gen-class?


Not sure why it wasn’t working before. Must have been a stale out/ or build/ output.


Yes, it looks like this:

(ns com.example.core
        :name com.example.core
        :methods [#^{:static true} [testPrintln [String] String]]))

(defn support [x]
  (println (str "Hello " x))
  (str "Hello " x))

(defn -support [x]
  (support x))


Ok. That is strange, with the settings you have above I would have expected that to work.


As you say, perhaps a clean build was required - I’m not sure.


It is working every time now. Hmm, not sure what it was o.O


The main thing I wanted was to be able to debug through Java and Clojure seamlessly, which I have now. Thank you so much for making that plugin!


I am going to get my company to donate to you once we have some Clojure code in production.


In my case, the dependencies are the other way around - my Clojure code depends on my Java code, and when I have to call into Clojure from Java I do it using


No problem! I’m glad you like it.


This was the clincher for us, to get Java and Clojure to easily call one another from the same project.


It is just too much of a comittment to go all in on a new language at this point


Thanks for the hint on


Yes, and sometimes it’s just not practical to rewrite everything 🙂


Fortunately with Clojure it’s not required - mixing and matching them is actually pretty easy.


I am excited to start using it more.


Sorry, that should have read


Ok, thanks. I’ll be reading the Java interop section of Stuart Halloway’s book when it comes out in February so I’ll catch it there as well.


Ah, yes, “rebuild caches”. I had this before. Thx for the reminder.


Hello, I’m getting Error running 'REPL': Unknown error. How can I debug it?


A question about best practice: I have a project that uses Datomic and has a cljs frontend. Datomic is a private jar, so it needs to be installed locally in the project and checked into scm, so that Heroku gets it, but Cursive can't read dependencies from a local repo (, i.e. like this:

:repositories [["local" ~(str (.toURI ( "repo")))]]
I've seen suggestions that using an absolute path like this will work, but I haven't been able to make it work. Using a :local-repo solves the problem as I can keep the Datomic dependency in there, but then the project's classpath is too long to start a REPL as this adds a lot of characters beyond the standard ~/.m2 in each path, and it dies if I do this ( What's the best way to set up the project so that Cursive can find the dep it needs and can start a REPL? I'd really like it to run with a default run config or lein repl, and with the standard figwheel setup using a normal clojure.main.


not sure I understand but I have this in my project.clj and I never had to worry about Datomic

:repositories {""
                    {:url ""}
                    (let [username (System/getenv "DATOMIC__USERNAME")
                          password (System/getenv "DATOMIC__PASSWORD")]
                      (when (and username password)
                        {:username username
                         :password password})))}


i don't really want to add a dependency on an external private repository


if a new engineer needs the project, they shouldn't have to add env vars really. it may be unavoidable, which is why i'm interested in what the current best approach is. it seems a shame that cursive is the limiting factor here, so i was wondering whether there was a workaround


the gpg approach is possible, but i have not been able to get gpg working. it's cost me 2 days already and i've decided not to sink any more time into it!


Incidentally, I just tried exactly your approach and cursive still can't resolve the dependency


I never had problems with Cursive using my approach...weird!


I don't think cursive can execute code using ~ in a project.clj, it may be that you already had datomic in your local maven repo?


Cursive does execute code in the project files, or at least it delegates to lein which does that. The issue is generally finding relative files - Cursive runs lein in-process, and Java processes can’t change the CWD.


Cursive does some black magic which means that most of the functions work correctly, but things like (File. ...) will not since there’s no way to hook that.


@U053032QC I’ll look at that local-repo issue today, I’m sure I added support for that.


@U053032QC BTW does changing the (File. ...) in your local repo example to ( ...) work?


Ok, I’ve just investigated this. I have not tested this, but I believe the :repositories snippet should work if (File. ...) is replaced as described above.


:local-repo should also work. #1150 should be obsolete these days, if you’re still receiving an error with this could you send it to me?


I’m going to update those issues, so perhaps we can discuss over there.


:local-repo does work, i can mvn deploy:deploy-file the datomic jar and pom into a file within the project and commit that to scm, but then leiningen uses the local repo directory to put all its dependencies. Since the path to that directory is longer than the one in my home directory, it blows the max classpath length, and starting a REPL kills Intellij. So it's not practically usable even if it does work.


What’s the error you receive? The max classpath length thing should have been fixed, and I’m concerned that it kills IntelliJ - it shouldn’t.


Also, does using :repositories with io/file work?


@domingues Can you send me a copy of your log? Help-&gt;Show log in Finder/Explorer