Out of the box Scala support Cygwin, but this is only with the Windows command prompt-based bash terminal. If you have opted for the more UNIX-like terminal of RXVT then you will find that although the interactive Scala interpreter runs, you can't get it to do anything!
This has been raised as a bug (Ticket #2097) against the Scala project and graehl even posted a patch to changed the generation of the scala runtime scripts. As my Scala install was based on the downloaded Windows binaries (scala-2.7.6.final.zip) I couldn't directly use this patch, but I could examine it to see what graehl's fix was.
It appears that the key bit was to add the following Java command line option to the java statement that starts the scala interactive interpreter:
Technorati Tags: Scala, Cygwin, RXVT, Andrew Beacock
This has been raised as a bug (Ticket #2097) against the Scala project and graehl even posted a patch to changed the generation of the scala runtime scripts. As my Scala install was based on the downloaded Windows binaries (scala-2.7.6.final.zip) I couldn't directly use this patch, but I could examine it to see what graehl's fix was.
It appears that the key bit was to add the following Java command line option to the java statement that starts the scala interactive interpreter:
-Djline.terminal=jline.UnixTerminalSo the last line of my
bin/scala
file is:exec "${JAVACMD:=java}" $JAVA_OPTS -cp "$TOOL_CLASSPATH" -Dscala.home="$SCALA_HOME" -Denv.classpath="$CLASSPATH" -Denv.emacs="$EMACS" -Djline.terminal=jline.UnixTerminal scala.tools.nsc.MainGenericRunner "$@"This appears to work, my interactive environment is now interactive!
Technorati Tags: Scala, Cygwin, RXVT, Andrew Beacock
Comments
very helpful :-) Now my putty-cygwin-combination works fine even with Scala. Thanks!
Scala console still needs a bit of work to get as good as Python, no code completion for starters.
Shame the maintainer seems to be a bit of a noob. Check out the last comment on the ticket.
http://lampsvn.epfl.ch/trac/scala/ticket/2097
And I'd consider myself a "serious" OS/Linux user.
Think.
http://sentimentalbryan.blogspot.com/2010/09/cygwin-scala-windows-7.html