Start Scala in TextMate

I am trying to run Scala in TextMate. I created a new variable TM_SCALA and set it to the path I got when I ran the following command in the terminal

which scala

      

But when I try to run the 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 cannot figure out the problem. Thanks in advance.

+3


source to share


2 answers


  • Make sure you download scala.

  • update PATH variable in TextMate settings. Add a scaling path there.enter image description here



+4


source


Add a new command (or replace "run script") with the following:

#!/usr/bin/env ruby -w

cmd = ENV['SCALA_HOME'] + "/scala -nocompdaemon -howtorun:script '" + ENV['TM_FILEPATH'] + "'"

result = "" + `#{cmd}`

puts "#{result}"

      



It is assumed that the SCALA_HOME environment variable is set something like this:

export SCALA_HOME="/path/to/my/scala/scala-2.11.4/"

      

0


source







All Articles