0
votes

I have a JAR with a class Proto$Event.class (compiled from Protocol Buffer). Now I want to use it in a Clojure Project.

I include the JAR on my clojure project following this steps.

But I am not be able to run this code in clojure:

(ns protocolbuf-test.core
  (:import
   (com.foo.bar Proto$Event)))

the error:

1. Unhandled java.lang.ClassNotFoundException
   com.foo.bar.Proto$Event

Any Suggestion?

Thanks

1
:import works only inside the ns macro - (ns foo.core (:import (com.foo.bar Proto$Event))). At the REPL, you can use the import function and you need to quote the list - (import '(com.foo.bar Proto$Event)) - ez121sl
Sorry @ez121sl. I use ns macro. Just omited here.... - Édipo Féderle

1 Answers

0
votes

Solved!.

probably something wrong with JAR version in my local repo. I Just remove the local repo (repo directory inside my Clojure project), then add the JAR again.

Thanks