score:1
Accepted answer
perhaps you have previously written an application whose main
method was in the animal
object. either delete the run configuration that points to this class or make animal
an application by making it an object
with a main
method, e.g.:
package animal
object animal {
def a: int = 10
def main(args: array[string]): unit =
println(a)
}
you can also use the app
trait and skip the definition of the main
method, than you could edit your code as follows.
package animal
object animal extends app {
def a: int = 10
println(a)
}
Source: stackoverflow.com
Related Query
- Could not find or load main class in scala in intellij IDE
- Scala - IntelliJ IDEA Error: Could not find or load main class
- Could not find or load main class (classname) in Scala Intellij
- Intellij IDEA Error: Could not find or load main class org.jetbrains.jps.cmdline.Launcher in Scala Project
- New scala project in Intellij - Error: Could not find or load main class
- Scala Error: Could not find or load main class in both Scala IDE and Eclipse
- Dockerize a scala app: Could not find or load main class
- 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
- Error: Could not find or load main class in scala
- Scala jar: Error: Could not find or load main class
- Scala bazel Error: Could not find or load main class
- Reason and fix for "Error: Could not find or load main class Anne" on Scala Getting started tutorial
- Error when building Scala Maven project: Could not find or load main class scala_maven_executions.MainWithArgsInFile
- Gatling Error: Could not find or load main class Engine
- Scalatra could not find or load main class
- SparkSession throw Could not find or load main class
- Could not find or load main class org.scalatest.tools.Runner
- Error: Could not find or load main class with Spark in Eclipse
- Error: Could not find or load main class io.gatling.app.Gatling
- Could not find or load main class com.weekdays.claobj.Ann1
- Error: Could not find or load main class com.sundogsoftware.spark.RatingsCounte
- How to fix 'Error: Could not find or load main class' on scala application in Intellij?
- Could not find or load main class sbt-assembly executable jar
- Error: Could not find or load main class scala.tools.nsc.Main
- Could not find or load main class Platform during docker container running
- Could not find or load main class Spark Docker
- Error: Could not find or load main class com.sparkarma.spark.WordCount
- Error: Could not find or load main class Files\Eclipse Caused by: java.lang.ClassNotFoundException: Files\Eclipse
- Error: Could not find or load main class: Scala IDE/Spark
More Query from same tag
- Maven not discovering ScalaTest unit tests
- Is it possible to pattern-match an Iterator in Scala?
- spark data frame converting row values into column name
- Spark 2.x using HiveThriftServer2 with sqlContext
- why where in scala is nearly 400 times slower than in java?
- how to share vals between build.sbt and assembly.sbt
- Spark Stuctured Streaming: StreamingQuery.awaitTermination() does not exit after writing all data to Kafka
- How to use play framework FakeApplication() for multiple tests?
- Dropping MySQL table with SparkSQL
- Issue about Intellij IDEA with scala
- Why is it not possible (in scala) to provide implementation for an abstract override method in the implementing base class
- Akka streams pass through flow limiting Parallelism / throughput of processing flow
- Scala Path Dependant Return Type Case Class Copy
- Scala double definition (2 methods have the same type erasure)
- How to use an Object in a trait by using its type in Scala
- Get last element of list in Spark Dataframe column
- values, types, kinds,... as an infinite sequence?
- IntelliJ source code editor shows false compilation errors
- Illegal character error when define Seq
- wrapping an asynchronous process in an akka actor
- Combination of map and filter nulls out in Scala
- Optimize Scala JSON Parsing
- Spark with Cassandra: Failed to register spark.kryo.registrator
- Should I report this assertion failure? What is $asInstanceOf anyway?
- Configure Java heap space with Spark
- creating a new instance of a type in scala
- How this stream's type is casted?
- Scala - how to filter a StructType with a list of StructField names?
- What is the most standard(/concise) way to compare the lists to check whether they have partial matches?
- playframework 2 module and logs to output