score:0
package structure must correspond to directory structure in the ide. (this is unlike scalac.)
it's hard to tell from the info you present, but i can confirm that scala ide (on eclipse luna) will not offer "run as > scala application" if i remove the package declaration.
for example, if the class app
in directory src/p/
(source file src/p/app.scala
) is not in package p
, then it won't offer to run it.
uncommenting the correct package declaration gets the run as
menu back.
i can also verify that a debug config with stop in main
and scala jvm launcher
works as expected for app
in the default package as well as in a named package. so i don't know how that could have broken for you.
score:0
you need to add extends app
to your main objects.
object app extends app {
def main(args : array[string]): unit = {
var logger = logger.getlogger(this.getclass())
if (args.length < 3) {
logger.error("=> wrong parameters number")
system.err.println("usage: mainexample <path-to-files> <srccode> <tablename>")
system.exit(1)
}
println("in main class")
}
Source: stackoverflow.com
Related Query
- scala Ide Not identifying my class as main method
- Scala IDE Error: Main method not found in class 'hello'
- Could not find or load main class in scala in intellij IDE
- Scala Error: Could not find or load main class in both Scala IDE and Eclipse
- Scala IDE Error -could not find/load main class
- Scala Main Class not found in Eclipse ide
- Error in running Scala Program: Main method not found in class main, please define the main method
- Main class not found error while creating Maven Project in Scala IDE
- Spark Scala Error - Error: Main method not found in class
- In Scala static value initialization does not appear to be happening before the main method is called
- Main method is not called in Scala script
- Renaming a .scala file in Scala IDE does not rename the class
- Scala case class is not matched in receive method (in akka actors)
- Scala - IntelliJ IDEA Error: Could not find or load main class
- Alternate constructor on Scala case class not defined: not enough arguments for method
- unapply method of a case class is not used by the Scala compiler to do pattern matching, why is that?
- Scala method clone in class Object cannot be accessed in T Access to protected method clone not permitted because
- Could not find or load main class (classname) in Scala Intellij
- Scala 2.9.2 can not handle the overloaded format method of the String class - why?
- Scala - not a case class nor does it have method .unapply
- not found: type in main method scala
- Dockerize a scala app: Could not find or load main class
- Intellij IDEA Error: Could not find or load main class org.jetbrains.jps.cmdline.Launcher in Scala Project
- Error: Could not find or load main class Main Scala
- Kafka 8.2.0 on Scala 2.10/Windows - Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain
- Scala: Main method not found in class
- Main method works for java, but not scala
- Scala compile error: member of method parameter not visible to class method
- Scala abstract generic class with a generic method not compiling
- Error: Could not find or load main class in scala
More Query from same tag
- Inteliij IDEA : Gatling getting j.l.NullPointerException while running simple script
- Force Play to JSON serialize timestamps as strings, not integer seconds
- Scala macros: constructing an anonymous class
- Cannot download sources from jar in intellij with maven
- What is the appropriate return value when the pattern matched is Nil and we want to return Nil?
- Error: Could not find or load main class com.sundogsoftware.spark.RatingsCounte
- How Static allocation in spark works?
- scala convert deep quoted arrays to array<array<array<array<double>>
- NoSuchMethodException when retrieve method by reflection
- Scala - Recursive view bounds
- Writing nested JSON in spark scala
- Scala lambda function with map function
- scala implicit conversion error on java generic type while using thirdparty java package
- Why stack overflow error with this Scala code?
- Wrong type after type casting using asInstanceOf Scala
- Kafka java.io.EOFException - NetworkReceive.readFromReadableChannel
- Accessing Nested Elements
- Deserializing Json array into Scala object
- Scala reflection with Int parameter
- How to remove parentheses around records when saveAsTextFile on RDD[(String, Int)]?
- Spark in Scala - Map with Function with Extra Arguments
- Scala: Example of using Casbah to write / update / delete objects in MongoDB?
- Scala 3 macros trait arguments
- Scala traits and implicit conversion confusion
- Scala handle division by zero over aggregate
- Unresolved dependency when Scalatest used with Spark
- Lazy generation of all binary sequences of a given length in Scala
- Get Seq index from element in Spark Sql
- Slick silently fails when no MySQL java driver provided
- Expose private case class in Scala