IDEA is full of this type of problems related with Scala. Sometimes, thinking to return to Eclipse! CrazyCoder I'm sorry if this is not the case, but I am so cranky with all the time that I expend with working around. Sometimes I try to help, for example stackoverflow. Thanks motek96 for providing the answer right here in your question. Interestingly, I had issues only for the project open during the upgrade from Also I managed to get the git version of this project to work, after some hassle.
Show 1 more comment. Active Oldest Votes. Improve this answer. CrazyCoder CrazyCoder k gold badges silver badges bronze badges. And the 1. I upgraded my project to sbt 1. Sadly this didn't fix the problem for me. Add a comment. It might help. It worked this time, but what actually is happening? Why this has fixed the issue? In my case upgrading the Scala plugin via IntelliJ options made the trick. It could be related to a fixed issue. Go to Preferences, filter on Scala.
If you are building your project using external sbt i. I'm an absolute Scala beginner. I was wanting to get up and running. I needed to create a Scala project , not a Java project with Scala library:.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 7 years, 5 months ago. Active 2 months ago. Viewed 30k times.
Environment: Play 2. Improve this question. Apparently a workaround is to create a new IntelliJ scala project, select a scala home directory where 2. I love the Scala language, but the brittleness of the tools just really makes me mad. You don't need to use gen-idea task in IDEA SBT support is now built-in. Perfect, Vladimir.
Even better than gen-idea. You can make this the answer. Add a comment. Active Oldest Votes. Run again, it should work now. For example, the following dependency definition uses Scala only for tests:.
When using a Scala dependency other than the standard library, add it as a normal managed dependency. For example, to depend on the Scala compiler,. Note that this is necessary regardless of the value of the autoScalaLibrary setting described in the previous section. This should not be a normal dependency of the project, so sbt adds a dependency on scala-compiler in the special, private scala-tool configuration. It may be desirable to have more control over this in some situations.
Disable this automatic behavior with the managedScalaInstance key:. This will also disable the automatic dependency on scala-library. If you do not need the Scala compiler for anything compiling, the REPL, scaladoc, etc… , you can stop here. Otherwise, sbt will still need access to the jars for the Scala compiler for compilation and other tasks. You can provide them by either declaring a dependency in the scala-tool configuration or by explicitly defining scalaInstance. In the first case, add the scala-tool configuration and add a dependency on scala-compiler in this configuration.
The organization is not important, but sbt needs the module name to be scala-compiler and scala-library in order to handle those jars appropriately. In the second case, directly construct a value of type ScalaInstance , typically using a method in the companion object , and assign it to scalaInstance. You will also need to add the scala-library jar to the classpath to compile and run Scala sources.
To use a locally built Scala version, configure Scala home as described in the following section.
0コメント