Skip to content

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

Description

@jimka2001

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions