Eclipse will not recognize my Scala main -
what i've tried:
- ensuring scala perspective set, disabled, set again
- ensuring right click on object extends app
- i never 'run scala application...' @ point
- defining explicit 'main' in object after removing 'extends app'
what 'run configurations..." when right-click on object main(). no matter there, e.g. enter name of object extends app or has explicit main, main() never found , classloader stack trace dumps indicating there no main.
while no scala compile errors, no matter try, never 'run as...scala application'.
code:
object fatfinger extends app { import com.mongodb.casbah.imports._ import common._ import mongofactory._ */ object insert { def main(args: array[string]) { val apple = stock("aapl", 600) val google = stock("goog", 650) val netflix = stock("nflx", 60) savestock(apple) savestock(google) savestock(netflix) } def savestock(stock: stock) { val mongoobj = buildmongodbobject(stock) mongofactory.collection.save(mongoobj) } } }
stacktrace:
exception in thread "main" java.lang.noclassdeffounderror: insert caused by: java.lang.classnotfoundexception: insert @ java.net.urlclassloader$1.run(urlclassloader.java:202) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:190) @ java.lang.classloader.loadclass(classloader.java:306) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:301) @ java.lang.classloader.loadclass(classloader.java:247)
Comments
Post a Comment