Error: Could not find or load main class in Scala

333 views
Skip to first unread message

Navin Manaswi

unread,
Jan 15, 2016, 2:53:43 AM1/15/16
to Scala IDE User
I get the error : Error: Could not find or load main class org.test.spark.SparkTest :: when i run this code in Scala IDE


package org.test.spark
import org.apache.spark.mllib.tree.DecisionTree
import org.apache.spark.mllib.tree.model.DecisionTreeModel
import org.apache.spark.mllib.util.MLUtils

object SparkTest extends App {
// Load and parse the data file.
val data = MLUtils.loadLibSVMFile(sc, "TrainingNagios1.csv")
val splits = data.randomSplit(Array(0.7, 0.3))
val (trainingData, testData) = (splits(0), splits(1))

// Train a DecisionTree model.
//  Empty categoricalFeaturesInfo indicates all features are continuous.
val numClasses = 2
val categoricalFeaturesInfo = Map[Int, Int]()
val impurity = "gini"
val maxDepth = 5
val maxBins = 32

val model = DecisionTree.trainClassifier(trainingData, numClasses, categoricalFeaturesInfo,  impurity, maxDepth, maxBins)

}


How can we run this code ? (IS SBT must for it ?)

David Bernard

unread,
Jan 15, 2016, 3:25:34 AM1/15/16
to scala-i...@googlegroups.com
Hi,

Do you have error in the project ? (if any error in the project, then no class is generated)

--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/e73930a1-18da-415b-97df-8d0af57dbbed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages