Learn how to stop testing everything every sprint and only test the code you’ve changed. Brought to you by Parasoft.

Clojure is quickly becoming one of the more popular JVM languages because of its high performance and excellent handling of concurrency. Rich Hickey's talk entitled
"An Introduction For Java Programmers" is a great resource for Java programmers who are interested in learning Clojure. For a basic overview of Clojure you can check out this
Clojure Scripting tutorial, but one of the most sought after pieces of knowledge is how to interoperate [http://clojure.org/java_interop] between Java and Clojure. There are several ways to
interoperate including embedding Clojure in Java and calling Clojure from Java. This short tutorial explains a method for calling Clojure from Java.

Some sites will recommend using clojure.lang.RT. For this method, we assume that you've already built a .jar from your Clojure project and added it to the class path.
Calling Clojure from Java isn't accomplished simply by compiling to a .jar and calling the internal methods. This example uses a simple Clojure file that can be compiled to a .jar (the example uses Clojure-1.1.0 .jar):

Take note of the :methods keyword in the gen-class statement. This lets you access the Clojure function in a way similar to Java's static methods. Then you just create a wrapper function that Java can call. You can also see that the second version of -binomial has a dash in front of it.

Because it is implemented as a Java class library, Clojure can also be easily embedded your Java applications, load code, and call functions. Bob Martin of Object Mentor has another example of calling into Clojure from Java on his blog post:
"Java Calling Clojure"

Get the top tips for Java developers and best practices to overcome common challenges. Brought to you by Parasoft.