Created
August 24, 2020 06:40
-
-
Save willhyper/edebf2deb472ee8bfceb83f3df0ba6e1 to your computer and use it in GitHub Desktop.
clojure-java interop. adding off-shored jar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; lein new interop-clj | |
| (def lib (jlib.Library.)) | |
| (.method1 lib) | |
| (.method2 lib) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 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; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; 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