Fork me on GitHub

If I want to use babashka for project automation scripting, in a cross-platform way, would using the jar be wise?


Currently getting this error, but maybe I need to use a newer version of Java?

[[email protected] calva]$ java -jar bb.jar -h
Exception in thread "main" java.lang.UnsupportedClassVersionError: sci/impl/Reflector has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0


Yeah, in this case the jar was byte compiled with JDK 11

👍 1

Is it only runnable with that specific version? I tried the above with jdk 15 and got IllegalArgumentException: Uknown signal: PIPE


Hum, it should be runnable with JDK 15


[[email protected] calva]$ java -version
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (build 1.8.0_275-b01)
OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)


Thinking about it, I'm not sure the cross-platform / include-the-tool-in-project really is a big concern. Devs already need other tools to work on a given project. 😄

Eccentric J04:02:39

Worst case you could build a static binary with graal maybe? The babashka docker file and scripts are pretty manageable


Thanks. It seems for dev use it makes sense to just require the developer of Calva install the bb binary for their machine.


@brandon.ringe I'm not sure if the .jar adds anything beyond a normal clojure project. babashka is basically a clojure interpreter + a set of libraries. So using it from the JVM kind of defeats the purpose of good startup time.


Maybe you could explain your use case more. If this is just used as an alternative to clojure inside of Calva I suggest using the deps.clj jar.


Latest Calva actually is using deps.clj for this (on Windows). Have I then introduced a requirement for some special version of Java?


As for @brandon.ringe’s use case it is for a script during Calva development. We’ll probably just require that people have babashska installed to use the script.


I thought you are using bb.exe


It added a bit too many megabytes to the extension, so I switched to deps.clj.


Makes sense


As for scripting for development. I think people should just install bb for Calva dev. It's available for every major OS


Or you can make your scripts portable with clojure by adding a deps.edn


so people can run the scripts using that if they don't have bb and don't want to use it.


But maybe it's ok to be opinionated for dev mode


> As for scripting for development. I think people should just install bb for Calva dev. It’s available for every major OS Yes, that’s where we are going.