Reputation: 2204
I am trying to run Scala in TextMate. I have created a new variable TM_SCALA and set it to the path which I obtained on executing the following command on the terminal
which scala
But when I try to run a Scala program, I get the error
Run Script: line 4: scala: command not found
This is the run script
#!/usr/bin/env bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
scala -classpath . -savecompiled "$TM_FILEPATH"
I am unable to understand the problem. Thanks in advance.
Upvotes: 3
Views: 901
Reputation: 3409
Make sure you have scala downloaded.
update PATH variable in TextMate preferences. Append scalac path there.
Upvotes: 4
Reputation: 4234
Add a new command (or replace the 'run script' one) with this:
#!/usr/bin/env ruby -w
cmd = ENV['SCALA_HOME'] + "/scala -nocompdaemon -howtorun:script '" + ENV['TM_FILEPATH'] + "'"
result = "" + `#{cmd}`
puts "#{result}"
That assumes that you have a SCALA_HOME environment variable set to something like this:
export SCALA_HOME="/path/to/my/scala/scala-2.11.4/"
Upvotes: 0