0

I'm trying out 'Play Framework 2.0' on Scala IDE plugin 2.0, for Eclipse Helios (fully supported by Scala IDE plugin).

When I create a play application and choose Scala template, it does work. That is,"play run".

When running 'play eclipsify' and then importing the project into Eclipse, I am getting errors. Any ideas?

enter image description here

Anuj Balan
  • 7,629
  • 23
  • 58
  • 92
jsidlosky
  • 407
  • 1
  • 5
  • 17
  • Possible duplicate of http://stackoverflow.com/questions/6177851/errors-in-eclipse-for-scala-project-generated-by-play-framework – Ed Staub Mar 23 '12 at 00:49
  • On second thought... probably not a dupe, though some of the answers seem relevant. For some reason, Eclipse thinks it's a Java source file - looks like you need to add Scala-ness to the project somehow. – Ed Staub Mar 23 '12 at 01:03
  • Yeah I saw the other question and it's not exactly a dupe. I tried a number of things from that post with failure to resolve. I uninstalled Scala IDE and then Eclipse rightfully doesn't do any syntax highlighting. However, looking at the errors, its obviously to me trying to build this with the java compiler for some reason. I fresh installed everything, so strange it doesn't work for me 'out of the box'. – jsidlosky Mar 23 '12 at 02:19

5 Answers5

2

The screenshot reveals that you're in the Java Perspective. Go to Window - Open Perspective - Other... and pick Scala.

When you create a new Scala project, eclipse asks you to switch perspective. If you import an existing project however, it doesn't. I filed an enhancement request.

Lukas Rytz
  • 1,894
  • 14
  • 27
2

On the Scala IDE website there is a tutorial on how to configure the Scala IDE to do development with play2.0:

http://scala-ide.org/docs/tutorials/play20scalaide20/index.html

Follow the steps there and if it doesn't work please report issues to the tutorial's author or in the scala-ide-user ML.

By the way, I don't believe that changing Perspective will make any difference. The Eclipse perspectives are purely UI changes, the underlying behavior should not be affected.

Mirco Dotta
  • 1,300
  • 8
  • 13
0

I was waiting, hoping someone more knowledgeable would answer...

I'd look at the .project file for your messed-up project, compare it with a correct one, and hack the messed-up one as appropriate. I wish I could be more specific. I'd guess that the problem is in the <buildSpec> or <natures> section of the file.

You may want to back up the .project file up first. Make sure the project isn't open in Eclipse while you're editing it.

Ed Staub
  • 15,480
  • 3
  • 61
  • 91
0

Right click your project, Configure > Add Scala Nature

Elvan
  • 621
  • 3
  • 4
0

I installed Eclipse Java-EE edition instead of standard Java Edition, and all works now.

I haven't gone back to repeat with standard Java Edition to confirm, but seems to only work with EE edition.

jsidlosky
  • 407
  • 1
  • 5
  • 17