Created
July 17, 2021 19:00
-
-
Save KnowledgeGarden/39742ae9ae641f0d8facb31b288ece4c to your computer and use it in GitHub Desktop.
ClassNotFoundException with imported Interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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