If you’re following the Coursera Scala course, you may come across this problem during the example assignment:
cd example
sbt
> console
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
(Lots of [info] stuff omitted for readability.)
The nicest way I found to get around this (on a Mac) is to create the file ~/.sbtconfig containing:
export SBT_OPTS=-XX:MaxPermSize=128M
That cured the problem and is safer than hacking /usr/local/bin/sbt.
You may also hit a problem where Eclipse does not have the Run configuration for Scala (the forums are full of comments about this). A workaround is to install vanilla (classic) Eclipse and plugins manually.
- Download Eclipse: http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.7.2-201202080800/eclipse-SDK-3.7.2-macosx-cocoa-x86_64.tar.gz
- Start Eclipse, then go to Help > Install New Software
- Enter http://download.scala-ide.org/releases-29/milestone/site, name it something clever like “Scala IDE”, select Scala IDE for Eclipse and click Next, Next, accept the license, Finish.
- Do the same for http://download.scala-ide.org/ecosystem/dev-milestone-2.9/site/ but this time select Scala Worksheet.
- Restart.
Now you should have “Run as Scala Application” as the second option in the Run menu.