In Search Of Building Java With Clojure

I am not learning Clojure for a whim, and therefore do not just want to learn build environments just for now or just for a course assignment. But where to find cake documentation? Right now, what has me confused is adding Java — a Java class — to a Clojure application built with cake.

Where is it? And how do I find it? And it is not for the lack of looking or asking.

Advertisements

7 Comments

Filed under Clojure

7 responses to “In Search Of Building Java With Clojure

  1. You probably have to set your :java-source-path in the project.clj, I honestly don’t know what’s the default value (if there’s one).

    While cake is being merged into leiningen[1], you might want to migrate to lein and check its documentation. Cake related stuff are being removed or obsoleted (e.g. no more google group).

    [1] https://groups.google.com/forum/#!topic/leiningen/WnnQIZipG5E

  2. Hey there,

    In order to add a Java class to a cake managed app, you just need to ensure that the class is in the classpath. Any Java classes you pull in via maven (by specifying the dep in your project.clj and fetching them with cake deps) will be automatically added to your classpath and will be available to your Clojure app. If your class is in an arbitrary location, you can modify your classpath directly in your .cake/config file by adding the line:

    project.classpath = /path/to/your/dir/which/contains/your/class

    Also, I should point out that cake is being merged with lein going forward, so you might want to look into the development of lein 2.0

  3. DPX-Infinity

    If you want info on project.clj file format, you can safely drop to sample.project.clj (https://github.com/technomancy/leiningen/blob/master/sample.project.clj) in leiningen repository – AFAIK, cake and leiningen project files are completely identical in structure.
    If you want information on cake itself (invocation, plugins etc) you can use cake wiki – https://github.com/flatland/cake/wiki

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s