N
Common Ground News

How do I run an SBT Assembly in IntelliJ?

Author

James Craig

Updated on March 03, 2026

How do I run an SBT Assembly in IntelliJ?

IntelliJ now allows you to create a run configuration for an SBT task. You create the Run Configuration by : choosing "Edit configurations" from the "Run" menu (or the toolbar popup) click the "+" button to add a configuration and select "SBT Task" as the type of configuration you want to make.

Consequently, how add SBT to IntelliJ?

  1. If no project is currently opened in IntelliJ IDEA, click Open or Import on the welcome screen. Otherwise, select File | Open from the main menu.
  2. In the dialog that opens, select a file that contains your sbt project description build. sbt.
  3. In the dialog that opens, click Select as Project.

Similarly, what is SBT Assembly? sbt-assembly creates a fat JAR - a single JAR file containing all class files from your code and libraries. By evolution, it also contains ways of resolving conflicts when multiple JARs provide the same file path (like config or README file).

Similarly, it is asked, how do I run a SBT file?

Running the project

  1. cd into hello-world .
  2. Run sbt . This will open up the sbt console.
  3. Type ~run . The ~ is optional and causes sbt to re-run on every file save, allowing for a fast edit/run/debug cycle. sbt will also generate a target directory which you can ignore.

How can I change SBT version?

properties file.

  1. Create or open your sbt project.
  2. In the Project tool window, in the source root directory, locate the build. properties file and open it in the editor.
  3. In the editor explicitly specify the version of sbt that you want to use in the project. sbt.version=xxx. Copied!
  4. Reimport your project. ( Click the.

What does SBT stand for?

SBT
AcronymDefinition
SBTState Bank of Travancore (India)
SBTStrange But True
SBTSistema Bibliotecario Ticinese
SBTScan-Based Trading

What is SBT build tool?

sbt is an open-source build tool for Scala and Java projects, similar to Apache's Maven and Ant. Its main features are: Native support for compiling Scala code and integrating with many Scala test frameworks. Continuous compilation, testing, and deployment.

What is SBT in IntelliJ?

Integrates with Simple Build Tool (SBT) to enable building Scala projects easily and quickly. Offers a console where SBT commands can be entered interactively, and a Before Run task to delegate project compilation to SBT, as an alternative to the built in IntelliJ Make.

How can I get SBT version?

Running the command, "sbt sbt-version" will simply output your current directory and the version number.

What is SBT test?

sbt is an open-source build tool for Scala and Java projects, similar to Apache's Maven and Ant. Its main features are: Native support for compiling Scala code and integrating with many Scala test frameworks. Continuous compilation, testing, and deployment. Build descriptions written in Scala using a DSL.

How can I tell if SBT is installed on Windows?

Running the command, "sbt sbt-version" will simply output your current directory and the version number. There's a difference how the sbtVersion task works in and outside a SBT project. When in a SBT project, sbtVersion displays the version of SBT used by the project and its subprojects.

What is SBT shell?

sbt shell is part of the scala plugin, which is similar to the above mentioned sbt console and can autocomplete commands.

How do I create a SBT file?

Creating the project
  1. If you didn't create the project from the command line, open up IntelliJ and select “Create New Project”
  2. If you already created the project on the command line, open up IntelliJ, select Import Project and open the build.sbt file for your project.

How can I stop SBT?

To return to sbt, type :quit, Ctrl+D (Unix), or Ctrl+Z (Windows).

How do I open a .scala file?

To execute external script (load all definitions from it) in REPL use :load <filepath> command instead of scala <filepath> . Your file Hello. scala is a script. You should be able to run it from the command prompt with scala Hello.

What does SBT package do?

'sbt package' will produce a jar file. Sure, you can use 'sbt package' command, it creates a jar file but this jar will be without any dependencies. Afterward you can just run 'sbt assembly' command, it provides a fat jar file with all dependencies that you can deploy and run anywhere and at any time.

What does SBT clean do?

Removes all generated files from the target directory. Compiles source code files that are in src/main/scala, src/main/java, and the root directory of the project. Automatically recompiles source code files while you're running SBT in interactive mode (i.e., while you're at the SBT command prompt).

How do I run a Scala command line?

To run Scala from the command-line, simply download the binaries and unpack the archive. Start the Scala interpreter (aka the “REPL”) by launching scala from where it was unarchived. Start the Scala compiler by launching scalac from where it was unarchived.

Where are SBT jars?

All new SBT versions (after 0.7. x ) by default put the downloaded JARS into the . ivy2 directory in your home directory. If you are using Linux, this is usually /home/<username>/.

How run SBT project from command line?

Running sbt with no command line arguments starts sbt shell. sbt shell has a command prompt (with tab completion and history!). To compile again, press up arrow and then enter. To run your program, type run .

What is a fat jar?

A Fat JAR is a single JAR file that contains all the compiled Java classes from your project, and all compiled Java classes from all JAR files your project depends on (see Maven Dependencies). Fat JARs are handy when you need to build an executable JAR file, e.g. a microservice executable.

How do I deploy an executable JAR file?

Deploying an Executable JAR File
  1. Select and right-click the simple archive or client icon in the Navigator to display the context menu.
  2. Choose Properties.
  3. Click JAR Options in the tree.
  4. Select Include Manifest File (META-INF/MANIFEST.
  5. In the Main Class field, enter the fully qualified name of the application class that is to be invoked.
  6. Click OK.

How does a jar file work?

Jar files in Java. A JAR (Java Archive) is a package file format typically used to aggregate many Java class files and associated metadata and resources (text, images, etc.) into one file to distribute application software or libraries on the Java platform.

How do I create a jar in Scala?

Create a jar file using 'sbt assembly' command. If you run 'sbt assembly' command before adding plugin it shows errors. 2. Distribute all the JAR files necessary with a script that builds the classpath and executes the JAR file with the scala commands.

How do I create a JAR file in Scala project?

To build a jar file with your application in case if you have no external dependencies, you can run sbt package and it will build a hello-world_2. 11_1. 0. jar file with your code so you can run it with java -jar hello-world.

How do I write code in Scala?

To write scala program you need to install scala on your machine. You must have latest jdk installed on your machine because scala compiler creates . class file which is a byte code. Scala interpreter executes this byte code by using jvm (Java Virtual Machine).

How do I create a Scala file?

Creating the Project
  1. Open up IntelliJ and click File => New => Project.
  2. On the left panel, select Scala.
  3. Name the project HelloWorld.
  4. Assuming this is your first time creating a Scala project with IntelliJ, you'll need to install a Scala SDK.
  5. Select the highest version number (e.g. 2.13.

How do I run test cases in IntelliJ?

Run or debug a test?
Press Shift+Alt+F10 to see the list of available run configurations or Shift+Alt+F9 for debug configurations. to the right of the list. Alternatively, select Run | Run Shift+F10 or Run | Debug Shift+F9 from the main menu.

How do I run a simple Scala program in eclipse?

Scala Hello World program using Eclipse IDE
  1. Step 1 : Create new Scala project in Eclipse. From File menu, select New -> Scala project and provide the project a name.
  2. Step 2 : Create a Scala object. Create a new Scala Object using File -> New -> Scala Object :
  3. Step 3 : Add code that prints Hello Scala.
  4. Step 4 : Run the Scala program.
  5. 1 Comment.