exiting REPL in Windows 7

95 views
Skip to first unread message

sampso...@googlemail.com

unread,
Jul 23, 2013, 6:21:11 AM7/23/13
to scala...@googlegroups.com
Having installed the current Scala binary in Windows 7 I started the REPL and
then exited with "exit()". It exited successfully but with the error message
'warning: there were 1 deprecation warning(s); re-run with -deprecation for details
TCC: C:\Program Files\scala\bin\scala.bat [92]  Unknown command "C:\Program"'

The package installs Scala in the "Program Files" folder of Windows, so I assume
this message means that the space in the name of the folder was unexpected.
I tried again with "sys.exit()" and again it complained that "C:\Program" was an
unknown command.

Windows is an OS that allows spaces in folder and file names.

Should the Scala folder be moved to a different folder? If so, what else needs to
be done e.g. changing environment variables?

Regards

John Sampson

Antoine Gourlay

unread,
Jul 23, 2013, 7:28:25 AM7/23/13
to sampso...@googlemail.com, scala-user

Oh, this bring back memories…

Anyway, using the :quit command is the preferred way to close the REPL. The deprecation warning is indeed about Predef.exit() vs sys.exit(), see SI-4563. But that whitespace error seems to be a bug in the bat launcher.

It manages to start the REPL successfully, so the error is not with starting scala. Looking at your error message, try replacing line 92 of scala.bat (the last one), which should be:

 @%COMSPEC% /C exit %errorlevel% >nul

with this (note the double quotes):

@"%COMSPEC%" /C exit %errorlevel% >nul

This happens to you because you use TCC (which is in Progam Files) as the default interpreter instead of cmd (which is in system32).

I'm opening a ticket, %COMSPEC% should always be escaped anyway.

— Antoine


--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Antoine Gourlay

unread,
Jul 23, 2013, 10:32:53 AM7/23/13
to sampso...@googlemail.com, scala-user

Som Snytt

unread,
Jul 23, 2013, 12:42:58 PM7/23/13
to Antoine Gourlay, sampso...@googlemail.com, scala-user

Why would anyone ever want to exit the REPL?

Ever!

For the record, if it makes you feel better, I had to fix some space-quoting for cygwin, too.  Command lines abhor a space the way nature abhors a vacuum.

There's another ticket about passing in jvm options on Windows.  And I actually could never use the script runner on cygwin, for whatever reason.  That's too bad, because it's kind of fun.

Antoine Gourlay

unread,
Jul 24, 2013, 5:12:08 AM7/24/13
to Som Snytt, scala-user
On Tue, Jul 23, 2013 at 6:42 PM, Som Snytt <som....@gmail.com> wrote:
There's another ticket about passing in jvm options on Windows. 

Oh right I got bitten by that once. While I'm at it, there it goes: https://github.com/scala/scala/pull/2767
 
And I actually could never use the script runner on cygwin, for whatever reason.  That's too bad, because it's kind of fun.

Why would anyone purposefully use cygwin to start scala? Especially now that Powershell is built in all recent versions of Windows and JLine works fine in it...
Reply all
Reply to author
Forward
0 new messages