Scala shell not running without super user privilege on ubuntu

81 views Asked by At

I have installed Scala via apt but when I try to run the Scala shell, it throws me a NoClassDefFoundError. When I try to run it using superuser privileges,it runs fine. Scalac runs fine without superuser privileges. after running the env command, I saw that SCALA_HOME was there but PATH for scala was not listed. I tried adding the path through bashrc, profile and /etc/environment but it isn't getting added to the PATH. My SCALA_HOME is /usr/share/scala My question is: How do I execute the Scala shell without superusr privileges?

EDIT1: After tweaking with SCALA_HOME and PATH I no longer have SCALA_HOME in my environment

1

There are 1 answers

9
jwvh On

On my ubuntu system (actually lubuntu) I have the following.

The primary executable in /usr/bin should already be in your $PATH. This is a sym-link to the actual executable.

0 lrwxrwxrwx 1 root root 26 Apr 13 01:24 /usr/bin/scala -> /usr/share/scala/bin/scala

The real scala executable is a bash script.

8 -rwxr-xr-x 1 root root 6208 Apr 13 01:24 /usr/share/scala/bin/scala

Note the file permissions on each.

I don't have SCALA_HOME set in my environment because the scala bash script does it's own calculations to figure that out.