I'd like to create one jar file to execute that is implemented with java and clojure. This is the step that I took.
Making my java code call clojure code
I could generate a jar file (ThingOne-1.0.0-SNAPSHOT-standalone.jar) that has clojure core and my clojure code, and I also could get a class file (HelloJava.class) that uses the clojure code in the jar file by following this site - http://walkwithoutrhythm.net/blog/2012/03/26/how-to-call-clojure-1-dot-3-functions-from-java/
The java code is as follows: clojure code is imported as ThingOne
import ThingOne.*;
public class HelloJava {
public static void main(String[] args) {
System.out.println("Hello from Java!");
core.foo (12345);
}
}
I can run this command to use the code:
java -cp 'ThingOne-1.0.0-SNAPSHOT-standalone.jar:.' HelloJava
Making one jar file
I made one jar directory that has this structure.
├── MANIFEST.MF
└── jar
└── ThingOne-1.0.0-SNAPSHOT-standalone.jar
The content of MANIFEST.MF is
Manifest-Version: 0.1
Main-Class: HelloJava
Class-Path: jar/ThingOne-1.0.0-SNAPSHOT-standalone.jar
I could get one jar file with jar cvfm hello.jar jar/MANIFEST.MF HelloJava.class
.
However, the clojure jar file (ThingOne-1.0.0-SNAPSHOT-standalone.jar) is not included in this jar file, but just referenced.
How can I make one jar file that contains the java class file and clojure jar file?