tags:

views:

106

answers:

3

I am starting Clojure development in Eclipse

I have a new package called "apackage" under src.

In it I have JavaClass.java and Test.clj. How do I call the constructor of the JavaClass from the clojure file?

I tried

   (def a (new apackage.JavaClass))

but I am getting a ClassNotFoundException. What am I doing wrong?

A: 

That is how you do it.

I have Clojuredev install in Eclipse 3.5 and what you described above just worked.

Perhaps you have misspelled something or your classpath isn't right.

Christian Vest Hansen
A: 

could be an issue with the :gen-class keyword in your name space deffinition.

Arthur Ulfeldt
+2  A: 

Figured out the problem. The Clojure file didnt have a namespace defined

I added (ns apackage).

kunjaan