Skip to content

agilecreativity/try-clj-interop

Repository files navigation

Clojure-Java Interop Example

Adapted from Clojure - Programming Cookbook

# Compile and run the example
lein run -m chapter05.TestHello

Usage

Run this from the terminal

# if the :main is not the same as this class
lein run -m try_clj_interop.TestPerson

# or the simple example
lein run -m try_clj_interop.TestHello

Creating a JAR file callable from Java

## Create the uberjar
lein uberjar

## Then check the target
ls -al target

## With this setup we can compile and run the preceeding Java code:
# compile the Java code with =javac=
javac src/java/TestPerson.java -cp target/try_clj_interop-0.1.0-SNAPSHOT-standalone.jar

# run the code with =java= (note the . before :target/..)
java src/java/TestPerson.java -cp .:target/try_clj_interop-0.1.0-SNAPSHOT-standalone.jar

License

Copyright © 2017 Burin Choomnuan

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.