Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KnowledgeGarden/39742ae9ae641f0d8facb31b288ece4c to your computer and use it in GitHub Desktop.
Save KnowledgeGarden/39742ae9ae641f0d8facb31b288ece4c to your computer and use it in GitHub Desktop.
ClassNotFoundException with imported Interface
We start with an interface specification, a snippet of which is this
(ns ie4clj.api)
(definterface Inferrable
(^boolean eval [])
(^boolean evalMembers [members])
)
We then use that interface in a test, a snippet of which is this
(ns ie4clj.Tests
(:require
[ie4clj.AndList]
[ie4clj.OrList]
[ie4clj.Not])
(:import (ie4clj.api Inferrable)))
(defn SimpleTrue
(reify
Inferrable <<<<<<<
(defn eval [] true)))
When that use had problems, the inteliij IDE added the import statement, so I assume that's how to use it
Now, in another file, a snippet of which is this:
(ns ie4clj.AndList
(:import (ie4clj.api Inferrable))
)
(defn AndList
(reify
Inferrable
(defn evalMembers [members]
I see the error message
Syntax error (ClassNotFoundException) compiling at (ie4clj/AndList.clj:1:1).
ie4clj.api.Inferrable
A question is this: why does the import work in the test file but not in the AndList file?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment