Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
root@ubuntu:/home/user# echo $SCALA_HOME

root@ubuntu:/home/user# cat /etc/environment 
share|improve this question
What is the output of which scala? – scai Sep 17 '12 at 11:46
empty, added some info into post – confused-demon Sep 17 '12 at 11:52
up vote 3 down vote accepted

Your PATH statement looks wrong, given your output:

root@ubuntu:/home/user# echo $PATH

The ${SCALA_HOME} should have expanded out there.

What did you add to your /etc/environment?


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:

share|improve this answer
added at the end of the post – confused-demon Sep 17 '12 at 12:18
@confused-demon I've updated my Answer. – cjc Sep 17 '12 at 12:34
Thanks. Yes, you are right. It was a sneaky stab from behind. Who would have known that such "sophisticated" ability as variable expansion was considered unnecessary when setting system wide variables... Crap :) – confused-demon Sep 17 '12 at 12:42
Personally, I've always used /etc/profile for this sort of thing, but I'm a holdover from the old days (and I tend to use RHEL/CentOS) before they invented fancy things like /etc/environment. – cjc Sep 17 '12 at 13:01
I wanted it to be in all users' profiles, that's why I used /etc/environment. In redhat I used just /etc/bashrc for this purpose and though it would work in ubuntu also. – confused-demon Sep 17 '12 at 13:04

You need to add /opt/scala/bin to your $PATH. Judging from the path, your Scala installation was probably compiled from source rather than installed with Ubuntu's package management (apt/dpkg).

share|improve this answer
PATH is above, and scala is not compiled there, just extracted (it is java app), though manually but not via apt-get – confused-demon Sep 17 '12 at 12:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.