inetelliJ idea - sbt plugin conflicts with Standalone sbt - scala

I want to setup a Spark-Scala-Sbt dev environment on Ubuntu
So i have installed SBT, Scala Seperately before installing IntelliJ.
But after installing intelliJ i have installed the sbt plugin for intelliJ as well.
Now how to avoid conflicts between the 2 sbt's which one to use and how to setup properly to avoid conflict.
Also wanted to know HOW .. the installed Scala & SBT is different from the scala & sbt plugin that comes with itelliJ IDEA

The standalone sbt plugin is obsolete with IntelliJ Scala Plugin 2017.1, which includes an integrated sbt shell and supports building through that shell.
To avoid any conflicts between different instances of sbt shells, it is best to have only one running at a time - either from the terminal or from IDEA. Other than that you don't need any special setup.

Related

How to use SBT with Intellij Idea

I am using Scala version 2.10 and SBT version 0.13.8. To build a project I am currently executing the sbt commands through the Intellij terminal but I would like to know the use of SBT Tasks window on the right hand side of intellij idea window. Kindly have a look at the screenshot uploaded
How can I run SBT tasks (compile, run, package) in Intellij from SBT Tasks? Is my intellij configuration correct?
It looks like you're using an older version of IntelliJ IDEA. That the window displays "tasks" is probably a bug, because running tasks from this window is currently not supported by the Scala Plugin. I still recommend upgrading IDEA to version 2016.3, which also supports a newer version of the plugin.
Instead, you can run them from the terminal as you do now, or create a run configuration clicking on Run -> Edit Configurations. Then click the + button to add a new configuration and choose SBT Task from the list, and entering the tasks you would like to run.
Side note: When using sbt for your projects, the Scala version installed on the system doesn't matter. In fact, it doesn't even need to be installed.

Installing a scala "ecosystem" on Linux (debian)?

Newbie to scala.
Reading some descriptions of how to install a scala ecosystem has me confused. I will be installing on a apt-based linux system. My choice of editor/ide will be emacs ( though I might play with Eclipse and IntelliJ ).
Not a java programmer. I also like to do projects as different users for different purposes.
From what I understand the steps are:
Install sbt from the linux distro repo as root.
Install the newest sbt from the installed sbt as root.
Install the newest scala from sbt as root.
Install ensime from sbt as root.
( or do I install it from melpa? )
Also I heard of something called Scala Worksheet which might be useful. The version I heard of is a Eclipse plusin. Is there a version that can be used with emacs?
You can install ensime as normal user from MELPA without problems. Just read carefully the instructions in their web page. It is important to install the ensime SBT plugin in the user directory instead of the project plugin directory.
The ensime integration works way better that Eclipse's Scala IDE.
About the worskheet, it would be nice to have it in emacs but it is not really needed . You can work quite fine just with sbt.

Call Bundled SBT's Commands in IntelliJ Scala Plugin

I am trying to call gen-android command after installing android-sdk-plugin to the project. However, I can't find out how to call a command of the bundled SBT, or do it outside of IDE.
How do you call commands of a bundled SBT of Scala plugin (v.2.2.0) in IntelliJ (v.15.0.3)? Or, is it possible to use the SBT executable outside IntelliJ?
I can of course use a normal SBT regardless but am just curious if I can do everything using one different SBT inside IDE (because it'd be convenient!)

Scala build process

First some context:
My aim is to use scala alongside a testing environment, preferably in an ide.
At first I installed scala (v. 2.10.1) and sbt and it worked. I used emacs and a shell.
Then I wanted to use eclipse and installed the sbt plugin. But when I tried the FlatSpec example of the scalatest website together with the scalatest lib, it did compile but 0/0 tests did run.
In intellij I tried the same example but although I gave my sdk location, the collection package wasn't found.
My problem:
I don't understand what I have to tell my ide or what I have to write (maybe files for maven or make etc.) or where I can learn all that.
My question:
What has the ide to know if I want to run a scala project?
- location of sdk, jdk, sbt, my_project, ...
- versions of scala, java etc.
What else must it know?
IntelliJ has build in support for sbt projects. My work flow is the following :
Create a project (in the shell) using sbt. Basically you have to create a build.sbt and the necessary directory structure
`src/main/scala`
`src/main/resources`
`src/test/`
The in IntelliJ just do Open -> select build.sbt.
Also check auto-import checkbox.
Everything should work after this.
NOTE: You may have to install the Scala and sbt plugin for the above to work.

IntelliJ 404 scala lang

Ok, I need some help in setting up a Scala project with IntelliJ, I have download and installed the project successfully, but i have had issues when it comes to installing the Scala compiler itself, WHen i go to configure a new Scalaa project and choose to set the Scala home, I choose the download Scala option and i get the following error "downloading failed, connection failed with error 404: http://www.scala.lang.org/downloads.distrib/files/scala2.10.0+RC2.tgz" i have tried downloading the things, such as primefaces and jSF through intelij, and they all work fine, any suggestions?
Download Scala manually and just select proper directory in new project window.
http://www.scala-lang.org/download/
You should be using SBT to define and build your project. Among other things, it handles retrieving the Scala compiler and libraries. IDEA is similarly self-contained as far as its Scala plug-in's internal Scala compiler is concerned. By using SBT and IDEA (see below for connecting the two), the only thing not covered is a Scala REPL for use outside of either SBT or IDEA. If you're using a Mac, Homebrew includes a Scala formula. Because SBT retrieves the Scala compiler and libraries for the version of Scala you specified, everything is self-contained.
By far the best way to build and maintain IDEA project definitions for Scala projects is with the sbt-idea plug-in for SBT. Once you install that plug-in, which is trivial, you simply use the gen-idea SBT task it provides. When your dependencies change, you run gen-idea again to update the project.