7

Installing SBT On Linux Operating System

 2 years ago
source link: https://blog.knoldus.com/installing-sbt-on-linux-operating-system/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Reading Time: 2 minutes

Introduction

Hi, welcome to the blog, I hope this blog will help you to get started with SBT on your Linux System.

Let’s get the party started…

Sbt Logo

What is Sbt?

Sbt is an interactive build tool for scala, and it is an open-source cross-platform build tool.

The main features of Sbt are:

  • Scala-based build definition that can use the full flexibility of Scala code.
  • Native support for compiling Scala code.
  • Supports mixture of Scala/Java Projects.
  • Support parallel task execution, including parallel test execution.

Steps for Installing Sbt on linux

  • To install sbt first you have to make sure that JDK is installed on your system.
  • If not then use the given command for installing the JDK
sudo apt install default-jdk
  • Verify that the JDK is installed or not by checking the version of the java compiler (javac) and by using the simple command as shown.
javac -version
  • Now open the terminal and enter the following commands because of which you will be direct to the sbt linux distribution and sbt to the source list
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list

Sbt CommandsFigure 2: Adding sbt URL to the source list

  • Next, run the below command for adding the scala key to the key list used by apt to authenticate packages.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823

Sbt CommandsFigure 3: Adding sbt to Apt’s key list

  • Now, download the package lists from the repositories to ensure that the list of information on the most recent versions of packages and their dependencies is up to date locally. sudo apt-get up-to-date
  • At last you have to run the given commands on the terminal so that your system will start installing sbt.
sudo apt-get install sbt

Sbt CommandsFigure 4: I already have sbt set up.

Congratulation….. you have successfully installed the sbt build tool on your system.

Now you are good to go to bang scala and java projects.

Conclusion

This is how you have installed the sbt on your Linux system

Refrence

https://www.scala-sbt.org/1.x/docs/

For more updates: https://blog.knoldus.com/

Scala Future


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK