sameersingh/scalaplot

Exception in thread "main" java.lang.NoClassDefFoundError: scala/Product$class

jimka2001 opened this issue · 1 comments

I'm trying to create a plot with scalaplot. If I use the approach using plotter.pdf and plotter.gui it seems to work.

    val plotter = new JFGraphPlotter(chart)
    plotter.pdf(outputDirName, outputFileName)
    plotter.gui()

However If I use the approach suggested in the webpage https://github.com/sameersingh/scalaplot, using

import org.sameersingh.scalaplot.Implicits._
import org.sameersingh.scalaplot._
val x = 0.0 until 10.0 by 0.01
val rnd = new scala.util.Random(0)

output(PNG("/tmp/", "scatter"), xyChart(
  x -> Seq(Y(x, style = XYPlotStyle.Lines),
           Y(x.map(_ + rnd.nextDouble - 0.5), style = XYPlotStyle.Dots))))

I get a java error.

java.lang.NoClassDefFoundError: scala/Product$class
at org.sameersingh.scalaplot.PlotterImplicits$PNG.<init>(Plotter.scala:27)
... 30 elided
Caused by: java.lang.ClassNotFoundException: scala.Product$class
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 31 more

BTW, should I really be using version 0.0.4 as indicated on the web page?

libraryDependencies += "org.sameersingh.scalaplot" % "scalaplot" % "0.0.4"