Can't get Scala support in Intellij-IDEA working (though I've done this a dozen times before) - scala

I have several machines. I just bought a new MacBook and installed Scala, set and then IntelliJ IDE. Nothing I do will make it correctly create or import a Scala project. I get message some times that the Scala library is not configured. Sometimes I can add the Scala Framework manually and sometimes Scala isn't an option in Add Framework. I have reinstalled SBT Scala, the Intellij Scala plugin and even IDEA. Every other machine is fine and I never had any problems - I'm going to have to give-up on Intellij at this point and use Eclipse (a cheaper option than sticking with the old laptop). I have different settings and options than the other machines as I'm on a slightly newer (2018.2) IDEA build but other than that I'm at a loss.
Anyone hit this before? What stupid thing have I done wrong?

The reason you get that is that there are certain combinations of SBT and IntelliJ that just don't work well together. Go to project/build.properties in your project and change your SBT version from to something like 1.1.1 (That one works well for me) and experiment. I know it is frustrating. Also be sure that IntelliJ and Scala plugins are upgraded.

Related

Incorrect Scala plugin configuration for NetBeans 8?

I'm running NB 8.0.2 on Linux Mint 17.1. I've followed the instructions twice, but still only see the "Scala Sbt Project" project template. I was expecting to see several non-SBT templates as well. I can, however, create and run Scala objects just fine, so I can work with it as it is, even if I'm not planning on using SBT.
Is something wrong with my plugin config, though, if I'm only seeing the SBT project template?
I've already gone through How do I add the Scala Platform in Netbeans? and other links, but this seems to be a NB 8 issue, as most of the posts/blogs concern NB 7 and 6. I didn't see anything about it on https://github.com/dcaoyuan/nbscala or https://blogs.oracle.com/geertjan/entry/10_steps_to_happiness_with .
Thanks,
Ari

Why does IDEA mark certain parts of Play code red?

I'm pretty new to the Play framework. I've been trying to configure it so I can use it with IntelliJ Ultimate.
I use following:
IntelliJ Ultimate 14.03
Scala plugin for IntelliJ 1.2.1
Play Framework 2.3.7 (the one that works online 1,2MB)
Scala 2.11
JDK 1.7
Windows 7
My problem is all about the fact that i can't make the errors disappear. Below is a simple example. When I create something more complicated (mapping etc.) I get entire blocks of red (also it does not suggest any code for the more complicated code).
What I've tried to fix it:
- deleting .idea folder and generating it again
- cleaning sbt
- generating a Play app from inside activator and also from IntelliJ
- re-installing IntelliJ
This is how I create the app from inside IntelliJ
I'm new both to Scala and Play, but I've done some research and I didn't end up with working solution. The same project works on Eclipse, but I would like to stick with IntelliJ.
The Scala plugin 1.2.1 is fairly outdated (given the development stage/pace of the Scala support in IntelliJ IDEA).
As of today, Jan, 29th, you should really be using the latest version of the Scala plugin 1.3.

possibility of scala-virtualized in Eclipse with Scala >=2.11

I followed this guide: http://lamplmscore.epfl.ch/mediawiki/index.php/Eclipse_IDE_with_Scala-virtualized
in order to use the virtualized (-Yvirtualize ) plugin inside the eclipse compiler. This works for a nightly build of Scala 2.10 which is old and lacks features like implicit classes. Does anyone know of a way to work with newer versions of Scala with the virtualize plugin AND eclipse?
Sorry to be bringing bad news:
The Eclipse IDE for Scala-virtualized has not been updated in the last 2 years, so it's not expected to be usable (Source: I maintained the EclipseIDE for scala-virtualized) -- I updated the wiki.
Regarding 2.11, please see Alexey's comment (and answer) below.
Scala-virtualized has been updated to 2.11.2 now. You can definitely use it in IDEA, at least (just make sure the Scala-virtualized scala-{library,reflect,compiler}.jar are above the non-virtualized versions in Dependencies tab under Project Settings -> Modules). I don't know if you can use it in Eclipse, but it might be possible using Scala installations support (see under BYOS (Bring Your Own Scala)).

Where does Typesafe Activator fit in the project

First of all, I would like to say that I don't know if Stack Overflow is the right forum to ask this, but let's give it a try.
I'm a .NET developer, but I'm interested in giving Scala a try in my next project. Developing for .NET is very "simple" in the sense that everything happens "inside" Visual Studio, from coding to installing libraries, to deploying, you get it.
I've stumbled upon the Typesafe Activator tool. My question is for Scala programmers who are using it: is this tool usually used as an IDE for the whole project? Or is it used just to generate the templates, then work in another IDE like Eclipse? What would be a usual "cycle" in web app developing project with Scala?
Thank you very much in advance!
Right now the code editor in Activator is pretty basic. So most users start with Activator for new projects and learning and then open the project in IntelliJ or Eclipse. Then you can continue using Activator alongside an IDE if you want.
I agree with James that it is common to create the project with Activator before then moving to your preferred IDE. I'm not even close to the expert he is, and that has worked for me.
But inconsistently.
For me, as an IntelliJ user on Mac, I have found that JetBrains (the makers of IntelliJ) continues to make so many changes to their Scala, SBT, and Play plugins that there can be inconsistencies. I've found starting from IntelliJ sometimes works; starting with Activator sometimes works; importing an SBT project of any kind sometimes works; and so on. I have yet to uncover any pattern as to why.
You may have better luck than I, but just be ready to try a few approaches. Using Activator first as James suggests is certainly a viable one.

Can I write scala code in netbeans6.9.1?

Is it possible to write and compile Scala code in netbeans6.9.1? I am a beginner to Scala programming, and am very much confused about this.
I've never actually tried to write Scala in Netbeans personally but according to Dick Wall the support for Scala in Netbeans is pretty much the best of breed among the main 3 IDEs (IntelliJ, Eclipse, and Netbeans). I know that's just anecdotal but it's from a pretty trusted source who literally inserted a whole new section into his Java Posse podcast just so he can geek out over Scala.
This looks like a fantastic place to get you started. http://wiki.netbeans.org/Scala
Yes, check out the Netbeans wiki; Scala modules are experimental and under active development, so check the nightly builds. Also check out ErlyBird; it's an Erlang/Scala IDE based on NetBeans.
I have successfully used Scala with Netbeans 6.8. I tried using 6.9, but could not get it to work.
If you can manage with NB 6.8, then you are in luck.
Note that even with 6.8, refactoring is not available. However, code completion works very nicely and that is sufficient for me. I hope that there is a more usable Netbeans plugin for Scala in the near future.
Of course, you need to install the Scala plugin after installing NB 6.8 to get anything to work. Instructions here: http://wiki.netbeans.org/Scala68v1