Bug 180441 - Run File NOT Working
Run File NOT Working
Status: NEW
Product: contrib
Classification: Unclassified
Component: Scala
7.1.2
All All
: P1 (vote)
: TBD
Assigned To: _ dcaoyuan
issues@contrib
:
Depends on:
Blocks:
  Show dependency treegraph
 
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
:


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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo