I have Ubuntu 10.04.4.
I downloaded and installed scala (.tgz archive), unpacked into /opt, set rights for read and execute in bin
for all users. Also updated PATH in /etc/environment
When I run program just with scala
command, though name is autocompleted it is not run:
root@ubuntu:/home/user# scala
The program 'scala' is currently not installed. You can install it by typing:
apt-get install scala
But if I use full path to executable it works.
Executables from scala/bin is in PATH (autocomplete works). What am I doing wrong?
root@ubuntu:/home/user# which scala
root@ubuntu:/home/user# whereis scala
scala: /opt/scala-2.9.2/bin/scala /opt/scala-2.9.2/bin/scala.bat /opt/scala/bin/scala /opt/scala/bin/scala.bat
root@ubuntu:/home/user# echo $PATH
${SCALA_HOME}/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
root@ubuntu:/home/user# echo $SCALA_HOME
/opt/scala
root@ubuntu:/home/user# cat /etc/environment
JAVA_HOME="/usr/lib/jvm/java-7-oracle"
SCALA_HOME="/opt/scala"
PATH=${SCALA_HOME}/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Your PATH statement looks wrong, given your output:
The
${SCALA_HOME}
should have expanded out there.What did you add to your
/etc/environment
?Update:
Ah, OK. /etc/environment is not processed by shell, so variable expansions, like you are trying in your PATH, will not work there. It only expects key-value pairs.
Put your updated PATH into
/etc/profile
or something similar. You should be able to keep your $SCALA_HOME and $JAVA_HOME settings in/etc/environment
, though, but the variable expansion will not work in there.(A similar question: https://askubuntu.com/questions/78856/referencing-environment-variables-in-etc-environment)
You need to add
/opt/scala/bin
to your$PATH
. Judging from the path, yourScala
installation was probably compiled from source rather than installed with Ubuntu's package management (apt
/dpkg
).