Play Project not compiling correctly in Intellij - routes_routing.scala - scala

I have a simple Play project with one controller (with a route) and a unittest.
When I type "sbt compile test" into terminal it runs fine and the test passes.
I cannot get the solution to compile correctly in IntelliJ however.
Controller: controllers.nisp.LandingPageController
Compile error:
.../nisp-frontend/target/scala-2.11/src_managed/main/app/routes_routing.scala
Error:(37, 18) object LandingPageController is not a member of package app.controllers.nisp
controllers.nisp.LandingPageController.showLandingPage(),
^
Directory structure:

I have solved this issue using the following method:
Upgrade to Intellij 14
Upgrade to the latest scala plugin.
Remove the whole project directory and re-cloned the source.
Use File -> Import Project -> SBT -> Auto-Import.

Related

scalac: Token not found: /Users/mpa/Library/Caches/JetBrains/IntelliJIdea2021.3/compile-server/tokens/54149

What means this exception and how can I fix it?
scalac: Token not found: /Users/mpa/Library/Caches/JetBrains/IntelliJIdea2021.3/compile-server/tokens/54149
I have a Scala 3 project in IntelliJ 2021.3:
It seamed to appear randomly when building the project with IntelliJ.
I tried:
sbt clean / sbt compile and sbt reload.
close IntelliJ / delete .idea folder and open Project newly.
Using sbt works just fine. So adjusting the config like this works, but I want to use the build from IntelliJ:
I faced the same issue with scala 2.13. File -> Invalidate Caches... option in Intellij fxed the issue for me

sbt Project name must be valid Scala identifier error while creating new project

I wanted to create a new project in scala in intellij. I have chosen Lightbend Project Starter and then Akka Quickstart Scala. On finish I got this error:
sbt Project name must be valid Scala identifier
The name of my project is "akka-demo" but "akkademo" and default "untitled" don't work either. Empty catalog is created. Same with other templates. How can I overcome this?
Env:
Intellij idea ultimate 18.3.4
sbt 1.2.6
As mentioned, akkademo should indeed work.
It sounds like an IntelliJ problem.
If a project directory was created, you can try to remove the .idea directory and reimport the project.
Furthermore, you can download the Akka Quickstart Scala project from Lightbend's website, and start the sbt shell in this directory.
Try to run and compile to make sure your environment is set up correctly.
If everything works with the sbt shell but not in IntelliJ, then open:
IntelliJ -> Preferences -> Build, Execution, Deployment -> Build Tools -> sbt and check the Use sbt shell for imports and for builds.
Then go to the sbt tab in IntelliJ and refresh.

Scala project with maven in IntelliJ does not compile

I created a scala project and included Maven framework in it. After that the code doesn't compile and hence when I run the file, I end up getting the following error
Error: Could not find or load main class main.scala.TestSpark
Mark scala directory as Sources Root.

intellij scala plugin won't compile after package rename

I'm using intellij 14.0.2 build#ic-139.659 and scala plugin 1.2.1
Im working on a basic project for a while and everything went well until i rename a package name.
Since then im getting this error and i cant compile and run the program
Error:(10, 8) not found: object Repo
import Repo._
^
When i'm generating the same code to eclipse it compile and run well.
Is that a bug or i`m doing something wrong ?
thanks,
miki

Can't import with IntelliJ SBT console

I installed Intellij's official SBT plugin (still in alpha), I imported without a problem a Scala SBT project (with build.sbt). But when I try to import something in the Scala console it prints this:
<scala> import recfun.Main._
<console>:7: error: not found: value recfun
import recfun.Main._
But when I launch exactly the same command with SBT running in the terminal it works fine.
What is the problem?
I found the following helped. I was working on a program imported using the SBT plugin, that had multiple sub-projects. This may also work if you have a native IntelliJ project with multiple modules.
Go to the menu "run -> Edit configurations ...", select Scala Console, and then in the box that says "Use classpath and SDK of module", pick the sub-project that has the build.sbt with the import statements you need (in my case server):
The import appeared to work after that.