Problem on error highlight using IntelliJ 10 CE with the scala plug-in - scala

I'm having some strange behavior in the IntelliJ editor when editing scala sources. It continuously report problem of kind "cannot resolve symbol" on various Predef functions like "require" and "->".
It seems to be only an editor problem because I am able to run scala code in Intellij and compile the sources using maven.
Am I the only one having this kind of problem ?
I'm using the Intellij version 10.0.3 CE and scala plugin version 0.4.735.
Thanks.

I would recommend using the latest IntelliJ IDEA EAP together with the latest Scala Plugin. This is known to solve a lot of problems.

Please, check the project configuration guide. It's likely that you forgot to add Scala standard library to the module dependencies.

Related

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.

Different version of scala lib in build path and scala-ide

I have two versions of scala (2.11.4 and 2.10.4). Currently I work on project based on scala 2.10. I've changed version in project properties but ide still complains about it:
The version of scala library found in the build path (2.10.4.) is different from the one provided by scala IDE (2.11.4.). Make sure you know what you are doing.
I am using
Scala IDE build of Eclipse SDK
Build id: 4.0.0-vfinal-20141216-1226-Typesafe
Project config:
Any idea how fix that?
That complaint is a warning, not an error; all is fine. I suspect the message is mostly left over from when scala-ide used to only support working with a single version of scala in a single install (which was only fixed in 4.0)
Yes, you can use the multiple scala version support, as described in this blog post.
Once correctly configured, as you showed in the image, this is just a warning and therefore safe to ignore.

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.

Scala Eclipse IDE - strange behavior

I am giving a try to Scala Eclipse IDE after a very long time. I installed Eclipse and the said Scala plugin only a while ago, but I am unable to get stuff working. In all of the Scala files, I get the errors like following (See the tooltip):
This project uses Gradle for building, and I also have the latest version of Groovy plugin installed. Please help me get this thing working. Thanks.
Edit:
Thank you, everyone. The problem was solved. It appears there was a problem with my Scala plugin installation. A complete reinstall of everything (including Eclipse) helped. Also, this time I did not install the Groovy plugin.
I don't know which version of Eclipse / Scala-IDE you're using, but there are two reasons I know this sometimes happens:
1) You don't have JDT weaving for Scala installed.
The scala-ide uses aspects to weave in code into the JDT compiler. If you don't have this installed, this may cause the Scala files to be seen as Java files.
2) If, somehow, the Java Source File content type includes *.scala. In fact, it should be Scala Source File. If this is the case, you should remove the *.scala from the Java Source File content type.

Scala IDE error - "projectname" is not a Scala project -

I have installed latest scala ide plugin to eclipse (Version: 3.4.2). It seems installation is ok without any errors.
I am able to create a scala project and add a package, but i couldn't add scala object, at the time it shows "projectname" is not a Scala project error message in add object dialog.
I have googled and found it could be related to JDT Weaving not enabled in eclipse. I have verified, its enabled and running in my environment.
Below the screenshot of the error.
alt text http://a.imageshack.us/img80/3070/scala.png
I just started scala.. Can someone help me to resolve this problem?
I had a similar error two minutes ago. Here's how I fixed it. I'm using Helios and the relevant Scala IDE version.
Right click on the project name --> Configure --> Add scala nature
I must mention that I have the M2Eclipse plugin as well and my project is a Maven project in addition to having a Scala "nature" .. Not that it should matter .. ;-)
The error message means your project is not recognize as a Scala one (as detailed in the scala.tools.eclipse.wizards.AbstractNewElementWizardPage.scala class.
But adding "Scala nature" to your project, as suggested by Alexey Romanov in the comments, might not be enough in this case.
The requirements mentioned in scala-ide.org clearly include:
Java Developer Toolkit 1.6
Eclipse Classic 3.5.2
So could you try with a more recent Eclipse version?
See Requirements and Installation, and then the turorial:
As mentioned, note the 'S' in the Scala project icon.