Skip to content

Shell scripts don't quote Scala home, breaks on paths with spaces, affects WSL #15823

Closed
@rubin55

Description

@rubin55

Compiler version

Scala compiler version 3.1.3 -- Copyright 2002-2022, LAMP/EPFL

How to reproduce

  1. Install Scala somewhere with spaces, like C:\Program Files\Scala\scala3
  2. Notice that WSL automagically adds Scala to the path because Windows has it in its path
  3. Try to run Scala.. see error

Output

# uname -a
Linux SURFACE 4.4.0-22000-Microsoft #832-Microsoft Fri Jul 15 14:40:00 PST 2022 aarch64 GNU/Linux
# which scala
/mnt/c/Program Files/Scala/scala3/bin/scala
# scala -version
Error: Could not find or load main class Files.Scala.scala3
Caused by: java.lang.ClassNotFoundException: Files.Scala.scala3

Expectation

Scala's shell scripts should (like its batch counterparts, and like other Java-based utilities, like ant, maven, gradle, groovy) handle paths with spaces. This is especially noticable by people who use Scala on windows in combination with WSL.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions