Support Questions

Find answers, ask questions, and share your expertise

How to set SCALA_HOME in linux

avatar
Contributor

Hi All,

I want to install scala in Linux as in sandbox centOS.

I have already downloaded scala-2.10.5 and also create a soft link for it in /us/hdp/current folder.

After that, I executed below commands to set PATH for SCALA_HOME.

echo "export SCALA_HOME = /usr/hdp/current/scala" 
or 
echo "export SCALA_HOME = /usr/hdp/2.5.0.0-1245/scala"

echo "export PATH=$PATH:$SCALA_HOME/bin" 

After that, I jumped at root directory in local and executed below command to execute .bashrc and .bash_profile files.

source ~/.bashrc 
source ~/.bash_profile 

I thought that is all. But I couldn't able to go into scala shell from anywhere.

Can anyone help me with this?

Regards,

1 REPLY 1

avatar
New Contributor

Hi,

Create a new file in /etc/profile.d/ named “your_scala_version.sh”. The full path should be “/etc/profile.d/your_scala_version.sh”. Then, enter these next two lines in the file:

export SCALA_HOME="/path to your scala folder"

export PATH="$PATH:${SCALA_HOME}/bin"


Then you need to restart the system. That's all.