Skip to content

Bloop doesn't use JAVA_HOME unless --bloop-jvm system is set (M1 mac) #1102

@kubukoz

Description

@kubukoz

Version(s)

0.1.7, it's been the case in earlier versions as well

Describe the bug

When using scala-cli v0.1.7 from the Releases page, even though JAVA_HOME points to an openjdk17, I still have to pass --bloop-jvm system for it to use what JAVA_HOME points to.

I believe #781 was supposed to solve this problem, but for some reason... doesn't. It still uses temurin in an x86 variant even though it's running on an M1 mac.

Here's the output of $JAVA_HOME/bin/java -version I'm getting.

openjdk version "17.0.3" 2022-04-19 LTS
OpenJDK Runtime Environment Zulu17.34+19-CA (build 17.0.3+7-LTS)
OpenJDK 64-Bit Server VM Zulu17.34+19-CA (build 17.0.3+7-LTS, mixed mode, sharing)

To Reproduce

  1. Get openjdk17 from zulu (e.g. from Nixpkgs)
  2. Get the scala-cli binary: https://github.com/VirtusLab/scala-cli/releases/download/v0.1.7/scala-cli-x86_64-apple-darwin.gz
  3. export JAVA_HOME=<wherever the jdk is>
  4. Create a foo.sc file with anything
  5. ./scala-cli compile foo.sc
  6. Check running processes to see which JVM is used

Expected behaviour

The JVM that JAVA_HOME points to is used.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions