score:0
I have a multi-module Gradle project. Most of them are Java and one is Scala. The project built successfully on the terminal, but IntelliJ complained missing SDK on the Scala code tabs.
The root cause might be that I opened this project before installing the Scala plugin. I restarted the IDE and clicked Reload All Gradle Projects
in the Gradle tab on the right-hand side. Then the problem was solved.
score:2
For MAC users:
With the latest IntelliJ IDEA 2020.2.2 (Community Edition) (Build #IC-202.7319.50, built on September 15, 2020), 2 things have to be done:
- Go to IntelliJ IDEA -> Preferences -> Plugins -> Scala
- Now, install scala using home-brew : brew install scala
Once these both are done, open a scala project and File -> Project Structure -> Global Libraries -> click on '+' -> Scala SDK -> select or download the sdk -> Add.
This worked for me.
score:3
Download and install Scala from Official web site. Create a new Scala SDK and point it to the scala installation path.(eg: C:\Program Files (x86)\scala ) Choose this SDK while creating the new project. Otherwise you can create the Scala SDK during the new project wizard as well.
score:4
So, what that solved that for me was:
- close intelliJ
- open the project folder and delete intelliJs folder that was added on import.
simply
rm -rf .idea
(mac/linux etc.) - import the project again...
score:5
I spent some 2 hours trying to figure a similar issue. My files were complaining that there was no Scala SDK setup and to add it as a module dependency. However the scala dependency was not compiled so it was giving errors.
The trick was to choose SBT as the model when importing the project and let IntelliJ add your dependencies.
score:19
i had this same problem to solve it right-click on your project and click "Add framework support" then click add library and navigate to the lib folder in your Scala directory in your pc
score:21
I'm assuming you mean Project Structure -> Modules -> Dependencies
You can just click on the Add...
button in that view. A "Module" here is simply a Jar file or directory containing classes.
You wouldn't normally do this though. A better approach is:
- Create the project using Maven and the maven-scala-plugin, then import it as a Maven project into IntelliJ
or
- Create the project using SBT, and use the SBT IDEA plugin to generate the IntelliJ project
Either way, the correct dependencies will then be created for you.
UPDATE
Based on your comment, it looks as though your problem is that IntelliJ doesn't know where to find the Java SDK (this is nothing to do with modules, it just happens to appear in that window)
Under Project Structure -> Project, you'll see an option for "Project SDK" with the value "" highlighted in red.
Click the new
button beside this, select "jsdk", and point it to the directory where you installed the Java SDK.
Then all should be good.
Source: stackoverflow.com
Related Query
- Module SDK for Scala in IntelliJ Idea
- Scala signature error for Scala module in IntelliJ Idea Maven project
- How to use Scala in IntelliJ IDEA (or: why is it so difficult to get a working IDE for Scala)?
- IntelliJ IDEA Hotkey for comment does not work with Scala
- Attaching sources in IntelliJ IDEA for scala project
- How to set up Java and Scala in one single Module in Intellij IDEA 11?
- Stuck at "Hello World" with IntelliJ IDEA 9.0.1 for Scala
- Partial EMMA code coverage in Scala Case Class for IntelliJ IDEA 10.5
- How to configure code style for Scala in IntelliJ IDEA
- IntelliJ Idea debugger's evaluator gives different results than normal program for comparing Scala Long and Float variables
- How to make Scala Power Pack for IntelliJ Idea to work?
- Unable to run integration test in Intellij Idea for scala project
- Scala plugin for IntelliJ IDEA 10 not detecting simple errors?
- Intellij Idea - what configuration to use for Scala
- Scala home directory for creating Scala project in IntelliJ IDEA
- Intellij Idea: Scala plugin: No compile library set for module
- Intellij IDEA - Cannot add framework support for Scala
- sbt version and scala version. project configuration for intellij idea with sbt-idea plugin
- Tell IntelliJ IDEA I want library sources for a Scala project after the fact
- Configure scala project sdk for idea
- code completion for liftweb scala in intellij idea
- Intellij IDEA doesn't show compile errors for Scala project
- IntelliJ IDEA stopped offering Run... commands for Scala project after upgrading to 2019.3.3
- IntelliJ IDEA stopped offering Run... commands for Scala project after upgrading to 2019.3.3
- Workflow and Scheduling Framework for Spark with Scala in Maven Done with Intellij IDEA
- How to create xml scala code format schema for IntelliJ IDEA
- Error while attempting to install scala SDK in IntelliJ Idea
- Where to get the SDK for Intellij iDEA for Scala?
- Setting up Intellij IDEA for Scala
- How can I use IntelliJ IDEA 10.5.2 to connect to a database for a Scala application
More Query from same tag
- How can I cast WrappedArray to List in Spark Scala?
- Advanced control of recursive parser in scala
- What is the most efficient way to implement a findOrCreate pool in Scala?
- MySql driver not found for Scala program
- Scala Play framework FunctionalCanBuild explain
- sbt : Is there a better way of structuring large build.sbt files
- Scala - How to merge incremental files of HDFS location
- What's the simplest definition of a MyList.flatten
- Wrapping a test in a transaction
- Run Scala Program with Spark on Hadoop
- Build List from binary tree inorder traversal using function "fold"
- Scala functional programming operator :::
- My First Akka project in IntelliJ from scratch. Compile dependency error.
- Lift login form
- Using DATEPART into a Slick Query
- Akka streams: how to use backoff strategy only in case of failure?
- Spark Scala Convert Sparse to Dense Feature
- Convert Set to individual objects in Scala Spark
- How do I bind a hazelcast node to a specific ip address?
- How to select from dataframe when column is optional
- Running jsdom in Nashorn
- Supplying "Class" type as a parameter to a method in Scala
- Scala - Generate all combinations (with order) and count
- Spark: Unable to find encoder for type Unit
- Convert Hadoop spark Scala function to Java
- How to convert response body in Json using play framework
- Scala: using Nothing for singleton instances of polymorphic types
- How do you assign a function to a value in Scala?
- scala: Retrieve arguments used to construct class instance in an inheritable way?
- performance of akka remote