以下代码取自:http ://www.jzy3d.org/tutorial.php
package diag;
import org.jzy3d.chart.Chart;
import org.jzy3d.chart.ChartLauncher;
import org.jzy3d.colors.Color;
import org.jzy3d.colors.ColorMapper;
import org.jzy3d.colors.colormaps.ColorMapRainbow;
import org.jzy3d.maths.Coord3d;
import org.jzy3d.plot3d.primitives.MultiColorScatter;
public class charttt
{
public static void main(String[] args)
{
int size = 100000;
float x;
float y;
float z;
Coord3d[] points = new Coord3d[size];
// Create scatter points
for(int i=0; i<size; i++){
x = (float)Math.random() - 0.5f;
y = (float)Math.random() - 0.5f;
z = (float)Math.random() - 0.5f;
points[i] = new Coord3d(x, y, z);
}
// Create a drawable scatter with a colormap
MultiColorScatter scatter = new MultiColorScatter( points, new ColorMapper( new ColorMapRainbow(), -0.5f, 0.5f ) );
// Create a chart and add scatter
Chart chart = new Chart();
chart.getAxeLayout().setMainColor(Color.WHITE);
chart.getView().setBackgroundColor(Color.BLACK);
chart.getScene().add(scatter);
ChartLauncher.openChart(chart);
}
}
它编译没有任何问题,但是当我运行它时,我得到以下异常:
**Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/opengl/GLCapabilitiesImmutable
at diag.charttt.main(charttt.java:35)
Caused by: java.lang.ClassNotFoundException: javax.media.opengl.GLCapabilitiesImmutable
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more**
关于出了什么问题的任何想法?