Skip to content

Instantly share code, notes, and snippets.

@willhyper
Created August 24, 2020 06:40
Show Gist options
  • Select an option

  • Save willhyper/edebf2deb472ee8bfceb83f3df0ba6e1 to your computer and use it in GitHub Desktop.

Select an option

Save willhyper/edebf2deb472ee8bfceb83f3df0ba6e1 to your computer and use it in GitHub Desktop.
clojure-java interop. adding off-shored jar
; lein new interop-clj
(def lib (jlib.Library.))
(.method1 lib)
(.method2 lib)
/*
* gradle init
* gradle jar
* cp build/libs/*.jar ../interop-clj/resources
*/
package jlib;
public class Library {
public boolean method1() {
return true;
}
public int method2() {
return 23;
}
}
; lein new interop-clj
(defproject interop-clj "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "https://www.eclipse.org/legal/epl-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]]
:repl-options {:init-ns interop-clj.core}
:resource-paths ["resources/jlib-0.1.2.jar"] ; <==== this is the line
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment