Cannot select the scala sdk when using Intellij after installed the scala plugin - scala

Everyone, thanks for your attention.
I'm using Intellij IDEA 2017.2 in windows 7, with Scala plugin installed.(I downloaded directly from the web and installed it from local disk.)
But when I wanna to add Scala sdk through "Project Structure-Global Libraries" , I clicked the menu "Scala sdk" which is shown in the picture below, it didn't appear by the popup window as expected, i.e, it didn't present anything.
So I cannot select the Scala sdk.
the picture describes the scenario
What should I do to make it work in Intellij? My scala version is 2.12.2.
Any advices will be appreciated.

Thanks for viewed and replied.I have found the problem.
It's wired. After I created a new project, I added scala sdk successfully within this project's structure.

I had the same issue with the Scala SDK selection doing nothing. (IntelliJ CE 2018.1 on macOS 10.13.2). To change my version of Scala (in this case going from 2.12 to 2.11 for Spark support), I deleted the 2.12 SDK from Global Libraries and noticed that IntelliJ could still build/run the project. So I changed the symlink it was reading the Scala library from to point to a 2.11 install. After restart IntelliJ still has no Scala SDK under Global Libraries and the button to add it still doesn't work, but it is using 2.11 which is all I needed.
I also tried Jimmy Liu's fix of creating a new Scala project but it didn't seem to have an effect.

Related

IntelliIdea - Cannot see scala in add framework support

I want to run scala code in IntelliJ Idea.
I donot see option scala in Add Framework Support
Please suggest how to do it?
To run the Scala code there is no need to add any framework or facet (things like this were done in some previous IntelliJ versions, but this is long ago).
The only thing you need is to install a Scala plugin.
If you did not install the plugin when installing the IDE, use menu item Settings, click on Plugin, then Marketplace and type Scala.
With a Scala plugin installed, you can create a new Scala project.

Intellij IDEA - Cannot add framework support for Scala

I have sbt 0.13.16 and Scala 2.10.6 running with Intellij 2018.2.1, working with those recommended sbt and Scala settings for Odersky's coursera course on Scala (I'm guessing their automated submission grader depended on old SBT?).
When creating new sbt + scala projects, I choose the above sbt and Scala versions, then after all the dependencies have downloaded, when I right-click New -> ... I see options for Java class but nothing for Scala. I have the Scala plugin already there according to the plugin settings.
So I try to Add Framework Support after right-clicking on the project, I select Scala, but then everything is disabled except Cancel.
I looked through previous forums, found one but that seemed relevant only for git projects.
Anyone else run into this issue? Do I need to update to more recent Scala and SBT? Any help would be very appreciated.
Please check https://plugins.jetbrains.com/plugin/1347-scala/versions for a compatibility table.
You can manage plugins in IntelliJ Preferences. Your versions seem to be too old to still be supported, already. It may help to upgrade IntelliJ and then go to preferences and get the latest Scala and SBT plugins.

Building a Play 2.6 project from IntelliJ builds nothing

I'm running my head into the ground trying to create a new "hello-world" level blank Play 2.6 project. I have successfully opened and run one of their example starter projects from the Play site in IntelliJ, and it works without issue.
However when creating my own I follow all the steps:
New project -> Play 2.x -> Setup as pictured:
And about 10 seconds later, this is all I get:
From my understanding, the whole structure should be available and displaying to me.
I don't know if it matters, but my Scala version is 2.12.1 and my IntelliJ version is the full version 2017.1 . I checked and the Playframework Support plugin is enabled, and so is Scala.
I'm also open to creating a "blank" one in SBT and then importing it into Scala, but unsure of how to do that either.
Thanks for the help.
Refresh your IDE, the latest Intellij IDEA version (2017.2) with up to date plugins creates a new Play 2.x project without a problem.

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.

jvm-1.6 is not a valid choice for -target in eclipse

I imported an android App written in Scala to eclipse but I got this error when I tried to run it:
'jvm-1.6' is not a valid choice for '-target'
Does anyone know how to fix this?
I've also encountered this.
The best answer I've managed to come up with is that the android app is set up for scala 2.10 but your eclipse is using scala 2.9 or lower, as 'jvm-1.6' is only valid for scala 2.10 and above.
If you do have scala 2.10 installed and eclipse is using it, then you should be able to change it in the scala settings:
Go to: Preferences -> Scala -> Compiler
Change 'target' in the 'Standard' tab to 'jvm-1.6'
I haven't verified this as I don't have scala 2.10 installed yet -- I haven't found a .deb file for it yet -- but this answer on Google groups seems to suggest this is the cause.