Using ScalaIDE (3.0.4-2.11-20140723-2253-Typesafe) I was having a similar problem with the Right Click Scala Test Class-> Run As -> Scala Junit Test
context menu.
I tried editting the class(but not for a compile failure), cleaning, closing the project, closing Eclipse. None of those worked to restore the context menu for classes that had previously worked well. The test classes don't use the @Test
annotation and instead use the @RunWith(classOf[JUnitRunner])
annotation at the top of the class using ScalaTest code.
When I tried choosing Scala Junit Test
from the Run Configuration launch editor directly, I received the dialog from the question. Footix29's answer was the key for me.
I noticed that even though I had cleaned my project a few times, my classes in the /bin directory hadn't actually been rebuilt in a while.
Here's how I got back the context menu, and was able to once again run Scala Junit Test
s:
manually
cleaned the classes by deleting the /bin/<package dir>*
via Explorer
Project -> Clean
ed the project along with a full rebuild
I suspect that a class edit in general is able to clean some saved state of Eclipse and get it going again. In my case all of the previously working classes I tried had failed so the manual
clean step was just the hammer I needed. However, other tricks that affect Eclipse's concept of the class path/build state should also work.
Further, I think that this behaviour was triggered in part by attempting to refactor a Scala class by renaming it( which the Scala Eclipse IDE sucks at ), where all the cleanup after the initial file change is manual. There were no build errors, but there were also no warnings that I was expecting meaning something was definitely stuck in Eclipse's build state info.