Scala install

From wikinotes

Archlinux

aur sync scala
aur sync scala-cli     # optional scala interpreter

# to compile/run programs you'll either:
pacman -S jre-openjdk  # minimal
pacman -S jdk-openjdk  # also acceptable, includes jre

FreeBSD

scala is in repos, scala-cli only added experimental freebsd support march 2024 and still needs some heavy lifting.


WARNING:

Running the executable is extremely laggy on freebsd.
This may be something to keep an eye on, but I'm not sure this is the right scripting alternative for me at the moment.

pkg install scala

official instructions https://scala-cli.virtuslab.org/install

pkg install openjdk17
curl -O 'https://raw.githubusercontent.com/coursier/launchers/master/coursier'
./coursier install scala-cli

# add to your zshrc
export PATH="$PATH:/home/will/.local/share/coursier/bin"

for now you may want to add --server=false to the shebang, since the server is flaky

#!/usr/bin/env -S scala-cli shebang

println("hello world")
./helloworld  # it works!

You'll need procfs/fdescfs mounted in your fstab for this to work.

# /etc/fstab
proc /proc procfs rw 0 0
fdesc /dev/fd fdescfs rw 0 0