Scala IDE error - "projectname" is not a Scala project -
Asked Answered
S

2

10

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?

Simdars answered 14/7, 2010 at 7:0 Comment(3)
Scala projects should show S in the top right corner of the folder icon, and not J. Try right-clicking on it; is there a "Scala" sub-menu in the context menu? If so, what items are there? In particular, if there is an item "Add Scala nature", add it and check if you can create a Scala class then.Trichromat
...and it is worth to mention that scala sub-menu is visible in the Scala perspective (at least in my installation, in Java perspective I don't have "Add scala nature" option).Sip
In my build (Eclipse Kepler Java EE) "Add scala nature" was under "Configure"Shoreless
C
9

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:

So could you try with a more recent Eclipse version?
See Requirements and Installation, and then the turorial:

alt text

As mentioned, note the 'S' in the Scala project icon.

Cornett answered 14/7, 2010 at 8:0 Comment(3)
Hi Vonc, i have installed the scala plugin for eclipse galileo in my VM.... it works great without any problems... but earlier i installed in eclipse galileo ganymede...Simdars
@Ramesh: "in eclipse galileo ganymede"? I don't recall of such an eclipse. Eclipse Ganymede is 3.4.x, Eclipse Galileo is 3.5.x, but there is no such think as an "eclipse galileo ganymede".Cornett
thats a typo :(.. i mean eclipse galileoSimdars
A
20

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 .. ;-)

Arsenide answered 5/3, 2011 at 7:1 Comment(1)
I've imported maven scala project into the most recent eclipse ide with scala ide installed and your answer was the only one allowing me to add scala classes from IDE without this annoying error... thanks!Sip
C
9

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:

So could you try with a more recent Eclipse version?
See Requirements and Installation, and then the turorial:

alt text

As mentioned, note the 'S' in the Scala project icon.

Cornett answered 14/7, 2010 at 8:0 Comment(3)
Hi Vonc, i have installed the scala plugin for eclipse galileo in my VM.... it works great without any problems... but earlier i installed in eclipse galileo ganymede...Simdars
@Ramesh: "in eclipse galileo ganymede"? I don't recall of such an eclipse. Eclipse Ganymede is 3.4.x, Eclipse Galileo is 3.5.x, but there is no such think as an "eclipse galileo ganymede".Cornett
thats a typo :(.. i mean eclipse galileoSimdars

© 2022 - 2024 — McMap. All rights reserved.