jacli icon indicating copy to clipboard operation
jacli copied to clipboard

Java Command Line Interface

Jacli is command-line-focused package manager, very similar to Npm, Rubygems, Pip, Homebrew, but for Java. Say, you have a JAR, which is supposed to be run like this:

$ java -jar foo.jar

To let your users use your foo.jar this way, you have to either make it "fat" or instruct them to download all dependencies and make them available on the classpath. In either case, they have to download binaries manually, for example with wget. Besides, you have to make sure they have the right version of the JVM installed. It's a hassle.

Instead, you use jacli and let your users do this (say, you are on MacOS and org.cqfn:foo:1.0.4 are the coordinates of the JAR in Maven Central):

$ brew install jacli
$ jacli install org.cqfn:foo:1.0.4
$ foo

You can also do uninstall, list, check, and so on. Jacli is checking the JVM for you, downloading all dependencies, creating the command line hook at /usr/local/bin/ and so on. It does everything you need in order to run this single JAR smoothly.

Jacli uses Maven under the hood and respects your settings.xml.

All you need to do in order to make your JAR jacli-ready is to put jacli.properties into its META-INF directory and release it to Maven Central (the pom.xml accompanying your JAR will be used to download dependencies):

binary=foo
jvm.min=8
jvm.max=13

BTW, we are aware of Coursier and SdkMan.

The logo is made by Freepik.