Fork me on GitHub
#babashka
<
2021-02-02
>
bringe00:02:38

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

bringe00:02:19

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

ericdallo00:02:32

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

👍 1
bringe00:02:33

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

ericdallo01:02:55

Hum, it should be runnable with JDK 15

bringe00:02:48

[[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)

bringe01:02:33

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

bringe20:02:54

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

borkdude08:02:54

@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.

borkdude08:02:41

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.

pez12:02:49

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

pez12:02:34

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.

borkdude12:02:46

I thought you are using bb.exe

pez12:02:48

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

borkdude12:02:44

Makes sense

borkdude12:02:14

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

borkdude12:02:28

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

borkdude12:02:37

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

borkdude12:02:29

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

pez13:02:15

> 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.