How to run main() in scala companion object

Hi,   I have a companion object for which main() is able to be run successfully using ant.  But going to the class in IJ, i get NSME:

Exception in thread "main" java.lang.NoSuchMethodException: com.knowtate.persist.GeoAddressParser.main([Ljava.lang.String;)
    at java.lang.Class.getMethod(
    at com.intellij.rt.execution.application.AppMain.main(

Process finished with exit code 1

By googling I found this was an issue resolved in version 2.8.0  - but i'm using 2.8.1 - at least think so (not sure how to see Scala compiler version - it's not listed as option under Project Settings | Compiler | Scala)

1 comment
Comment actions Permalink

It looks like this problem has gone away.  It may actually have had to do with a compilation error in a separate module that was not flagged. The way I found out was trying to run the debugger.   At that point IJ complained about the other module, i fixed that other issue, then it DID debug my scala app.

So that's a nice step forward.  

So the steps I did to get scala (more or less) working in IJ were:

  • Download and install the Scala plugin
  • Add the scala facet to the module
  • Create a Library that includes the scala-compiler.jar and scala-library.jar and include that library in the module containing the .scala source files

Please sign in to leave a comment.