Intellij IDEA 13: Error compiling sbt component - scala

I have a Maven Scala project created with archetype:
archetypeGroupId=org.scala-tools.archetypes
archetypeArtifactId=scala-archetype-simple
version=1.3
I'm getting this when trying to run a simple main method:
Error compiling sbt component 'compiler-interface-2.8.0.final-51.0'
The Maven build works fine though... I'm new to Scala so this is probably some simple problem.

The good people over at JetBrains had a solution:
Looks like this plugin is quite old and generates pom with an old
scala version. Try 2.10.0
Meant to post this sooner but I forgot about this question.

Related

Running Scala under Eclipse

I'm very new to Scala and I tried to run Scala project under Eclipse. I used sbt to create one, then ran sbteclipse to prepare it for Eclipse and imported it successfully. However when I try to run it I get
Error: Unable to initialize main class Main
Caused by: java.lang.NoClassDefFoundError: scala/Function0
error. Scala, sbt and Java are installed, because when I try to run the same project via console, using sbt, it works. What am I missing?
Thanks for any help!
It looks like the classpath of your Eclipse project is incomplete: it's missing the Scala library. Can you double check in Project Settings that the scala library is present?
If all you want to do is try a simple program, an simpler solution is to create a New Scala Project using the Eclipse wizard.

Play with Activator Issue on IntelliJ Idea 14

I have the following problem on IntelliJ IDEA 14:
I created a Play (Scala) project using the Activator (v1.2.10). Then, I converted it to an IDEA project using activator idea command. When, I opened the project with IDEA 14 (Community Edition) the SBT module is not enabled. Therefore, a new dependency in build.sbt file is not included in the classpath. Moreover, the project is not listed in IDEA's SBT view.
The following warning is shown by IDEA:
"This IDEA project is converted from an SBT project by gen-idea tool, which currently relies on a legacy Scala project model. Please consider using built-in SBT support via the Import project action."
Note that, the Scala and SBT plugins are already installed on IDEA.
I don't encounter with the same issue in IDEA 13.
Have you tried File | Import Project and select build.sbt file?
IDEA imports it as an SBT project, with all the dependencies properly resolved. It works fine for me on IDEA 14 and on 13.
Apparently, this is a bug in some versions of IntelliJ 14, that just got fixed (as of version 14.0.3). Updating IJ then updating the scala plugin seems to make things work.
In this case simply import manually the "build.sbt" from your project, so if the directory is ~/Documents/myPlayApp then choose to import ~/Documents/myPlayApp/build.sbt

`Cannot find symbol` in IntelliJ 14

I have use the IntelliJ Scala plugin before, in 13 and 13.1. I upgraded to 14, and it doesn't work anymore for my SBT project.
For all Scala standard lib stuff, I see errors like "Cannot find symbol scala.Option".
at scala project, compiler error - Cannot resolve symbol List? says I need to have the Scala facet for my module. I looked in facets, and Scala wasn't an option.
I've uninstalled IntelliJ and the Scala plugin and my settings and the projects files multiple times, but still happens.
How do I fix this?
the new scala plugin for intellij 14 removed the facet and replaced it with Scala SDK library, see blog
for sbt project, I guess the best bet is to re-create your project by:
File -> open -> select the build.sbt of your project in popup -> delete existing project and import
I had a similar issue when a Java module calls an Scala object. The issue was from the wrong setup in Source Folders; the Scala source was in src/main/scala/..., but in the Project Structure, the Source Folders were setup as src by default. When I changed it as src/main/scala, the Java module can find the Scala object correctly.
I fixed this by using the nightly builds of the Scala plugin.
The fixes have now been incorporated into the stable versions.
In my case i just had to reload the IDE...

IntelliJ plugin for cucumber-scala

I am running Cucumber scala project in IntelliJ
IntelliJ IDEA - 13.0.2
I couldn't find separate plugin called cucumber for scala
In my project I am getting cannot resolve message for cucumber as below
Could see below errors as well
Existing plugins installed
What could be the solution
Cheers
You are missing dependencies for cucumber-core and cucumber-scala, please have a look at the documentation and add them to your build.sbt file.
Update:
There is a newer version available for sbt-cucumber-plugin (0.8.0): https://github.com/skipoleschris/xsbt-cucumber-plugin. Maybe that solves your problems.
Did you try the gen-idea plugin to create the IntelliJ IDEA project files ?

Scala Compiler doesn't compile in ScalaIDE

I'm trying to develop on the Scala compiler project with the help of ScalaIDE. I followed this guide to set up the development environment. When I now try to build the mentioned projects, the reflect project won't get built. Instead, I get the following error via the console output:
uncaught exception during compilation: scala.reflect.internal.MissingRequirementError reflect Unknown Scala Problem
Having tried the provided ANT script of the project via the console, everything seems to work fine.
Does anyone know if I'm missing a hidden compiler flag, dependency or something like this?
Thanks!
With the IDE for Scala 2.10 you can only build the 2.10.x branch of the Scala compiler. If you want to work on master, you need to install a 2.11-based version of the IDE. We don't publicise IDE for 2.11 nightlies yet, but they are available at:
http://download.scala-ide.org/nightly/scala-ide-master-2.11.0-SNAPSHOT/