An example project with ZIO 2.x and Scala 3.x with native platform build packages.
Steps to generate native binary
- Download graalvm from https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-20.3.4
tar -zxvf graalvm-ce-java11-20.3.4\* -C .
export GRAALVM_HOME=<path to graalvm>/graalvm-ce-java11-20.3.4/Contents/Home
export JAVA_HOME=$GRAALVM_HOME
$GRAALVM_HOME/bin/gu install native-image
sudo xattr -r -d com.apple.quarantine <path to graalvm>/graalvm-ce-java11-20.3.4
The above steps are needed only for the first time.
Set the environment variable before starting sbt
.
export NATIVE_IMAGE_INSTALLED=true
More information at https://github.com/scalameta/sbt-native-image.