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 180441 - Run File NOT Working
Summary: Run File NOT Working
Status: NEW
Alias: None
Product: contrib
Classification: Unclassified
Component: Scala (show other bugs)
Version: 7.1.2
Hardware: All All
: P1 normal (vote)
Assignee: _ dcaoyuan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-08 13:43 UTC by krzychukula
Modified: 2012-05-14 21:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description krzychukula 2010-02-08 13:43:46 UTC
After Creating new Project with default Main.scala generated I can't run it.
using 'Run File' i get: Class 'pac.Main' does not have a main method! 
Source looks like this: 
package pac
object Main {
  /**
   * @param args the command line arguments
   */
  def main(args: Array[String]): Unit = {
    println("Hello, world!")
  }
}
.. so should work.
Run Project:

Could not load definitions from resource scala/tools/ant/antlib.xml. It could not be found.
init:
deps-jar:
C:\Documents and Settings\kris\Moje dokumenty\NetBeansProjects\ScalaApplication5\nbproject\build-impl.xml:403: The following error occurred while executing this line:
C:\Documents and Settings\kris\Moje dokumenty\NetBeansProjects\ScalaApplication5\nbproject\build-impl.xml:236: Problem: failed to create task or type scalac
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
BUILD FAILED (total time: 0 seconds)
Comment 1 fommil 2012-05-14 21:52:12 UTC
I get a similar thing with Netbeans 7.1.2, OS X 10.7, Scala 2.9.2 (via macports, if this is even being used) and Maven style instructions [1].

If I define a Main object and then attempt to run it with Shift-F6, then all I get is the java binary output printed to the console as if I had typed "java" (equivalent to "java -help") on the command line.

However, running via F6 if I make the project my Main Project and define the Main class seems to work OK, but that is a real hit to usability!

[1] http://www.hashcode.eti.br/?p=429