Monday 12 December 2016

How to install Scala and SBT in Cloudera Quick Start VM



How to install Scala and SBT in Cloudera Quick Start VM


This article is intended to the beginners getting their hands on Cloudera VM and looking to do initial setups.

If you have not already downloaded and installed Cloudera quickstart VM, please download here

Run the below commands at the shell prompt

$wget http://downloads.lightbend.com/scala/2.11.7/scala-2.11.7.tgz
$wget https://dl.bintray.com/sbt/native-packages/sbt/0.13.13/sbt-0.13.13.zip

SBT url is updated to latest version, but the screenshots are taken for older version. Use sudo in front of wget if you do not have permissions.

I have taken Scala 2.11.7 and sbt 0.13.11 versions here, but this approach can also be followed with higher version applications. Once you download both applications, follow the below steps.

 
Run the below command to untar the zip files.

 
You can follow same approach to untar sbt, here my sbt file is .zip format so I extracted from the context menu option in file explorer window. Once both files are extracted move them to the opt folder. Here I am moving files from downloads folder to opt folder.

 
We have to set the path for Scala and sbt to allow accessing them from anywhere in the shell. Here are we setting a user profile path, not the global profile. But you can do it either way. Run the below command.

 
And add the below lines.



Click ctrl+o to save it, if user profile is not existed already it will prompt you to save the file as a new file. If prompted, save it in your home directory. After saving, we have to initiate the profile to take effect in the terminal. Run the below command.

 
Type scala at the shell prompt, and you should see scala prompt


You are all set to start your development.!!!

No comments:

Post a Comment