fsc error when running scala script

41 views
Skip to first unread message

Noel Yap

unread,
Jan 4, 2017, 3:44:01 PM1/4/17
to scala-user
This works when using Scala 2.10 and is broken in both 2.11 and 2.12.

The following script:

#!/bin/bash

exec /opt/scala-2.12/bin/scala "$0"
!#
println("aoeu")

errors with:

fscbad option: '-Xsource:2.12.0'
  fsc -help  gives more information
error: source file '/home/nyap/proj/sum-of-power/-Xsource:2.12.0' could not be found
one error found

som-snytt

unread,
Jan 20, 2017, 9:23:49 PM1/20/17
to scala-user
You have to kill the compile server before running a different version.

$ scala210 y.scala
hi
$ scala y.scala

fscbad option: '-Xsource:2.12.0'
  fsc -help  gives more information
error: source file '/home/apm/tmp/-Xsource:2.12.0' could not be found
one error found
$ ~/scala-2.10.6/bin/fsc -shutdown
[Compile server exited]
$ scala y.scala
hi
$ ~/scala-2.12.1/bin/fsc -shutdown
[Compile server exited]

Seth Tisue

unread,
Jan 21, 2017, 11:38:19 AM1/21/17
to scala-user
I use -nocompdaemon in all my Scala scripts now, after having been bitten by this far more times than I care to admit.
Reply all
Reply to author
Forward
0 new messages