Welcome! Please see the About page for a little more info on how this works.

0 votes
in Errors by

I was trying to use a library that calls requiring-resolve (which any attempt to call would throw an IllegalStateException). While trying to find the issue, I found that when I call

System.out.println(Clojure.var("clojure.core/deref").invoke(Clojure.var("clojure.core/*clojure-version*")));

I get

Unbound: #'clojure.core/*clojure-version*

Is there some way to fix this?

1 Answer

+1 vote
by

It sounds like Clojure itself has not been initialized on the path through your Java code to get to the above. That would also explain the IllegalStateException from trying to use requiring-resolve -- and you'll see that error from anything you try to reference.

Without knowing more about how you built your Java program, it's hard to say what might cause this.

Taking a look at this small repo might help you: https://github.com/stuarthalloway/clojure-from-java

by
Is there a way that I can ensure that Clojure is being initialized on the path? I am using the Clojure Java API and my packages are managed with maven.
by
edited by
Can you get Stu's example repo working on your system? If so, can you figure out what might be different between your setup and that example?

Otherwise, you'll need to provide more detail about your code/build process etc.

Note: I had to add the following properties to the pom.xml file in Stu's repo in order to compile everything (since the default seemed to be Java 1.6 otherwise):

  <maven.compiler.source>1.8</maven.compiler.source>
  <maven.compiler.target>1.8</maven.compiler.target>
...