I'm trying to use Sublime Text 2 to edit and run Scala script under Windows 7 64-Bit using Scala 2.9.1. I've created the following scala.submline-build file, attempting to follow what happens when I enter the following from the command line:
C:\work\Scala>scala ScalaGreetings.scala
Greetings from Scala...
C:\work\Scala>
The contents of the scala.sublime-build are as follows:
{
"cmd": ["C:\\scala-2.9.1.final\\bin\\scala.bat $File"]
}
With the simple Scala script loaded in a Sublime Text tab, pressing the F7 key results in the Scala interpreter being loaded and running, but the script does not execute as expected. The following appears in the Build window:
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_01).
Type in expressions to have them evaluated.
Type :help for more information.
scala>
With this in mind, I would appreciate your help and feedback with the following questions;
1.) Can I execute a Scala script from within Sublime Text 2 and have its output display inside the Build window after the script is successfully interpreted?
2.) Assuming the answer to the question above is yes, what is missing and/or incorrect with my scala.sublime-text file?
3.) Are there any additional resources I should look at on using Sublime Text 2 with Scala, especially in the way of Sublime Project files for Scala?
Try using this instead:
{
"cmd": ["C:\\scala-2.9.1.final\\bin\\scala.bat", "$File"]
}
{
"cmd": ["C:\\scala-2.9.1.final\\bin\\scala.bat", "$file"],
"selector": "source.scala"
}
Note that since variable names are case-sensitive, $file
must be in lower-case.
The selector
setting helps Sublime automatically choose the build system.
For more info check the Sublime Text's reference on build systems.
try this build setting
{
"cmd": ["C:\\scala-2.9.1.final\\bin\\scala.bat","$file"]
}
i could solve with it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With