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

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.

Related

inetelliJ idea - sbt plugin conflicts with Standalone sbt

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.

intellij error while importing SBT project

I recently installed IntelliJ on Ubuntu 16.04, but I'm getting this error while trying to start a Scala project:
This is my first linux computer, and I installed the oracle 8 jdk through the package manager, not sure if it's something wrong with this configuration or something else. Am I missing some java variables? When I installed intellij before on Windows the scala package came with basically everything I needed, and I used the jdk windows installer.
I think your Intellij is missing the Scala SDK. Usually it would be picked during first time setup.
Open "Open Module Settings" of your project (by right-click), go to libraries, add an Scala SDK.
Hope it should fix your problem.

Does the download of Scala IDE 4.0.0 for Eclipse include SBT?

The download page at scala-ide.org for the pre-configured Scala IDE for Eclipse (4.0.0 Release) states that its content includes SBT 0.13.6. I downloaded the Mac OS X 64-bit version, and found that the /plugins directory indeed contains a jar file called org.scala-ide.sbt.full.library_0.13.6.v-2... Is this a replacement for having a separate installation of SBT on one's development machine, perhaps facilitating some tighter integration between the Scala Eclipse plugin and SBT? If so, how does it work?
Yes, it does indeed include sbt. It is used internally to control the build, notably the incremental compiler.
It isn't a replacement for having sbt installed on your machine, it isn't really accessible from outside scala-ide.
As for tighter integration, not at the minute.

IntelliJ IDEA w/ Scala Plugin not finding scala.concurrent

I am having the hardest time getting a fresh install of IntelliJ to work properly with Scala.
I've installed IntelliJ IDEA 13.1.4 and the Scala plugin on a Mac. In any project, the IDE complains it cannot find scala.concurrent (or any other package in scala-library) even though the library is listed under "External Libraries". What am I missing?
I've got the basic steps to reproduce down to:
Install IntelliJ IDEA 13.1.4
Install Scala plugin via IntelliJ plugins dialog
Create a new Scala project (either SBT or non-SBT, doesn't matter)
Define a new class and try to import scala.concurrent._
This happens with new or existing projects - even when provisioned via sbt gen-idea.
I've installed Scala and SBT via brew and even tried setting $SCALA_HOME to point to the brew install of scala (/usr/local/share/scala).
IntelliJ is listing the library in External Libraries but still can't resolve the symbol.
I have been fighting with this for hours. What am I missing here?
I had the same issue. I fixed it with Invalidate Caches
File | Invalidate Caches / restart. Manual way on Mac with removing this folder:
~/Library/Caches/IntelliJIDEAXX
I had the same issue and above advice didn't help me. After googling and reading JetBrains tickets, I found out that I had $JAVA_HOME variable pointing to JDK 1.7:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home
Removing that from both current shell (unset JAVA_HOME) and shell's profile (in my case .zshrc) resolved the issue.

Failure creating clojure project in Netbeans

I decided to take a look at Clojure and thought the best and easiest method for me would be to use Netbeans with the Enclojure plugin as I didn't want to have to learn Emacs at the same time. I installed Netbeans 6.9.1 together with the latest JDK using the bundled install (on Windows 7). All went smoothly. I then followed the instructions at http://www.enclojure.org/gettingstarted for installing the enclojure plugin.
When creating a new Clojure application I get the following and see no project files :
java.io.IOException: Could not connect to URL nbresloc:/org/enclojure/ide/templates/project/ClojureProjectTemplate-1.1-distribution.zip. No such resource was found.
Maven is working using mvn --version
I have installed on both Windows 7 and Ubuntu 10.04 (same result).
I have looked on the Enclojure forum and there is a recent open thread for this issue, but it is not solved by anybody presently.
I have Java SE enabled in Netbeans
I have tried enabling the different platform versions of Clojure, 1.0.0, 1.1.0, etc..
The REPL seems to be working happily in Netbeans : (printf "hello") hellonill
I did try ClojureBox on Windows 7, but again that's Emacs, but emacs failed to start the server and hung there and became totally unresponsive.
I come from a .Net background (not Java) so my knowledge of the Java environment is somewhat lacking. My reason for looking at Clojure and not Java.
I am new to Netbeans
If you're interested in a working Maven pom, here is one I've used with Enclojure successfully:
http://puredanger.com/techfiles/100624/pom.xml
There are some project settings you'll need to change and a few dependencies to remove but it might be a good start. In general, I usually create the pom first and then just import the project into NetBeans rather than using the NetBeans options to create projects.
By the way, the REPL work in Enclojure has been split and is coming soon to the Eclipse plugin Counterclockwise.
I had written a small post on it on my blog.
Anyways here is the procedure:
On searching realized that this is a common problem for installing it on > Netbeans 7.. But with some manual tweeks managed to install it. Here are the instructions to install on Netbeans 7. plus:
Install Netbeans 7. You need only the Java SE version.
First Run of Netbeans after installation. Activate feature Java SE
Activate features is on the Start page or from Tools,->Plugins>Installed, click ‘Activate next to the Java SE support
Install Maven: It is HIGHLY recommended that you install maven: http://maven.apache.org/download.html
Go to the Netbeans->Preferences, click on the Miscellaneous tab and make sure the External Maven Home path is pointed to your maven install
Download the EnClojure 1.5 version from here. If you want to manually build, you can do that by following the instructions from here.
After downloading the file, In Netbeans: Goto:- Tools ->Plugins->Downloaded->Add Plugins->Downloaded
Then browse to the downloaded file. Later install by clicking at the “install : button.
Restart and you are on the go.
Visit here to build and run hello world project.Basically building the EnClojure 1.5 manually is the tough job. I hope above was useful.