score:1
the main
method needs to be on a toplevel object. your bottles
object is wrapped in a main
class. remove that main
class and your code should run.
object bottles {
def main(args: array[string]){
var n : int=2;
while(n<=6){
println(s"hello ${n} bottles");
n+=1;
}
}
}
score:2
okay, also had the same error error: "could not find or load main class main" in my scala ide and the reason of that was that when i created main, i immediately moved it to a package.
so i had to:
- move my main class back to default package.
- clean, compile, run.
Source: stackoverflow.com
Related Query
- Scala Error: Could not find or load main class in both Scala IDE and Eclipse
- 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
- Error: Could not find or load main class with Spark in Eclipse
- 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
- Error: Could not find or load main class in scala
- Scala jar: Error: Could not find or load main class
- New scala project in Intellij - 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: Could not find or load main class ... in eclipse
- 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
- Eclipse scala "Could not find or load main class"
- 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 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
More Query from same tag
- Spark collect_list change data_type from array to string
- Formatting a number by passing number of decimal places as a parameter in Scala
- typed weakreferencequeu in scala
- Removing Data Type From Tuple When Printing In Scala
- Why can't a class extend traits with method of the same signature?
- Shapeless type disjunction for more then 2 types
- file is not being written in scala
- How to use string.split() without foreach()?
- Trying to Understand Least Upper Bound Example
- Object sql is not a member of package org.apache.spark
- Create a Simple Kafka Consumer using Scala
- How to calculate the difference of rows based on the other column value partitioned by user_id
- How to log queries?
- scala MutableList when foreach add element why not throw Exception
- Class not found exception when trying to run JAR file with Spark
- what is the use case for scala List's companion function returning GenericCompanion?
- How to overload super class method
- Strange behavior with reflection in Scala
- Merge rows in a spark scala Dataframe
- Cross-cutting "logical" scopes in multi-project sbt builds
- How do I count all of the co-occurring elements in a document line using Spark?
- Creating a TestActorRef results in NullPointerException
- Is var used when we do Spark programming in Scala?
- Slick filter nscala-time DateTime by greaterEqual or smallerEqual
- How to respond to an Ask pattern with a failure using Akka TestKit?
- How to make Squeryl work with the Play! Framework?
- Scala: method within a method
- Filter condition using filtered value
- Graphx: I've got NullPointerException inside mapVertices
- Efficient way of row/column sum of a IndexedRowmatrix in Apache Spark