Skip to content

Homebrew installation doesn't use native launchers? #4139

@SethTisue

Description

@SethTisue

Version(s)
Scala code runner version: 1.11.0
Scala version (default): 3.8.1

(but I think it's long, perhaps always, been this way)

Describe the bug
The scala command installed by Homebrew prints sun.misc.Unsafe warnings on launch. According to @Gedochao on Discord (https://discord.com/channels/632150470000902164/901153021638082660/1464372766244470977), this is evidence that the JAR is being launched, rather than a native binary.

To Reproduce
brew install scala

and then, on JDK 25,

% java -version
openjdk version "25.0.2" 2026-01-20 LTS
OpenJDK Runtime Environment Temurin-25.0.2+10 (build 25.0.2+10-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.2+10 (build 25.0.2+10-LTS, mixed mode, sharing)
% which scala
/opt/homebrew/bin/scala
% scala
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by scala.runtime.LazyVals$ (file:/opt/homebrew/Cellar/scala/3.8.1/libexec/libexec/scala-cli.jar)
WARNING: Please consider reporting this to the maintainers of class scala.runtime.LazyVals$
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by com.sun.jna.Native in an unnamed module (file:/opt/homebrew/Cellar/scala/3.8.1/libexec/libexec/scala-cli.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

Welcome to Scala 3.8.1 (25.0.2, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                    
scala> 

Expected behaviour
No sun.Misc.unsafe or other "WARNING:" messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginstallationEverything related to installing the CLI itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions