简体   繁体   中英

Use Clojure interfaces in a Java library project

I would like to use some of the Clojure interfaces in a Java library project in several situations where it would be useful for my Java classes to implement them. In particular:

Doing this would make my Java library much more user-friendly for Clojure-based users.

However I don't want to import the whole of clojure.jar as a dependency - since it is relatively large and my library is mainly targeted at Java users.

Is there a way to import and develop against the Clojure interfaces without bringing in the rest of Clojure?

Try it:

  1. unpack the clojure jar
  2. put only the .class you need into a directory named LightweightClojure
  3. run you test appli (test + lib + LightweightClojure)
  4. goto 2 until it works
  5. zip the LightweightClojure directory into LightweightClojure.jar

如果你使用的是Maven,你可以使用Maven Shade Plugin的minim-jar配置。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM