As of Scala Worksheet 0.2.1 it is not possible to control the worksheet working directory.
For security reasons, once a JVM is running, it is not (directly) possible to change the JVM's working directly. See Changing the current working directory in Java? for details.
Therefore, it is generally good practice to always specify fully qualified paths, or specify relative paths from a fully qualified "anchor point".
Here's a hack I came up with for getting such an "anchor point" in the Scala Worksheet
object WorksheetProjectDirHack {
// Yuck.... See: https://github.com/scala-ide/scala-worksheet/issues/102
import Properties._
val pathSep = propOrElse("path.separator", ":")
val fileSep = propOrElse("file.separator", "/")
val projectDir = javaClassPath.split(pathSep).
filter(_.matches(".*worksheet.bin$")).head.
split(fileSep).dropRight(2).mkString(fileSep)
val otherProjectFile = new File(projectDir, "src/main/resources/data.bin")
}
It basically works by taking advantage of the the existence of the .worksheet/bin
directory created in your Eclipse project directory and appended to the Scala Worksheet classpath.