This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 157069

Summary: Shift-F6 for a scala file with a main method does not work
Product: contrib Reporter: andreou <andreou>
Component: ScalaAssignee: _ dcaoyuan <dcaoyuan>
Status: REOPENED ---    
Severity: blocker CC: adnim
Priority: P3    
Version: 7.0.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description andreou 2009-01-19 15:22:24 UTC
I create a "Scala Application Main Object", producing this code:

object newMain {

 /**
  * @param args the command line arguments
  */
 def main(args: Array[String]) = {
   println("Hello, world!")
 }

}

And then hit Shift-F6 and a dialog pops up: Class "newMain" does not have a main method.

Hitting F6 runs the main class file normally (whichever the project is configured with).
Comment 1 _ dcaoyuan 2009-01-19 16:40:03 UTC
Have you checked the project properties setting:

Right click on project node, choose "Properties", then click "Run", there is a field "Main Class:"
Comment 2 andreou 2009-01-19 18:03:52 UTC
To clarify, running the main class is fine, I referred to the feature "Run File" typically available in java projects, 
where you only have to open any source file declaring a main method, and do Shift-F6, which invokes it.

At least you acknowledge the issue? Or is it something that happens only to me?
Comment 3 _ dcaoyuan 2009-05-06 14:35:06 UTC
Fixed: rev/8fe006d9f245
Thanks for patch from Ståle Undheim <staale@netbeans.org>
Comment 4 adnim 2011-09-06 18:20:12 UTC
Shift-F6 broken on individual files in 7.0.1.

Currently only reproducible with a manually added file, as the Wizard for creating a "Scala Application Main Object" does never finish. (I didn't create a ticket for this)
Comment 5 datadiggers 2012-11-30 11:02:24 UTC
Workaround:
Restart the IDE.

As no new comments has been added for over a year I would like to confirm that the bug still exists in nbscala-nb7.2-s2.10.0-v0.2 and Netbeans 7.2.