Java/Clojure mixed sources and package names with dash

120 views
Skip to first unread message

Shantanu Kumar

unread,
Jan 2, 2011, 1:47:42 PM1/2/11
to Clojure Maven Plugin
Hi,

I am having to write some Java code that needs to be compiled before
the Clojure code goes through the compile phase. I include the Java
sources in src/main/java/foo.bar package and the Clojure sources go in
src/main/clj/foo.bar package (and all works well) -- but what happens
when the package name is actually "foo-bar"? I tried mentioning the
java package name as "foo_bar" but it's not recognized in the Clojure
sources -- I got a ClassNotFoundException.

Was anybody able to resolve this? Please let me know.

Regards,
Shantanu

Mark Derricutt

unread,
Jan 2, 2011, 3:02:31 PM1/2/11
to clojure-ma...@googlegroups.com
You can't name a java package foo-bar - the dash/minus sign is illegal.

--
"Great artists are extremely selfish and arrogant things" — Steven Wilson, Porcupine Tree

Jim

unread,
Sep 18, 2012, 12:14:14 PM9/18/12
to clojure-ma...@googlegroups.com
what if the folder is called "foo-bar" but the package declaration declares it as "foo_bar"? Isn't this allowed? I too get a ClassNotFoundException.
I cannot find the precompiled java classes through clojure! I have tried decompiling a couple of classes and the package declaration is indeed correct : foo_bar...tried requiring it from clojure with and without the hyphen but no success!

any clues?
thanks in advance...

Jim 
Reply all
Reply to author
Forward
0 new messages