Scala install: Difference between revisions

From wikinotes
No edit summary
 
Line 10: Line 10:
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Archlinux -->
</blockquote><!-- Archlinux -->
= FreeBSD =
<blockquote>
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.<br>
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.
}}
<syntaxhighlight lang="bash">
pkg install scala
</syntaxhighlight>
official instructions https://scala-cli.virtuslab.org/install
<syntaxhighlight lang="bash">
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"
</syntaxhighlight>
for now you may want to add <code>--server=false</code> to the shebang, since the server is flaky
<syntaxhighlight lang="scala">
#!/usr/bin/env -S scala-cli shebang
println("hello world")
</syntaxhighlight>
<syntaxhighlight lang="bash">
./helloworld  # it works!
</syntaxhighlight>
You'll need procfs/fdescfs mounted in your fstab for this to work.
<syntaxhighlight lang="fstab">
# /etc/fstab
proc /proc procfs rw 0 0
fdesc /dev/fd fdescfs rw 0 0
</syntaxhighlight>
</blockquote><!-- FreeBSD -->

Latest revision as of 22:48, 12 May 2024

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