Access .java src files in Reference Library that don't have .class files

262 Views Asked by At

I'm using Eclipse 3.8.0 on OSX 10.7.5 and I'm trying to run jzy3d-9.0 (a 3d graphing package). There are at least two libraries that I need import. The first library came in both .class and .java files, which I was able to add to my reference library successfully. The second library has only .java files and there seems to be a problem related to that. Can I make a reference library without the .class files?

I've tried working around that solution by including the .java files in the build path, but each file has a package declaration at the top which creates an error for each file.

This is an example of code I would like to run. Just above where I highlighted in the code is import org.jzy3d.chart.Chart, which is from the first library, so I know it has loaded successfully. The line I highlighted shows that org.jzy3d.chard2d.Chart2d, which is from the second library, can not be accessed.

In the resource tree, the first highlighted line shows the successfully loaded first library while the second and third highlighted lines show my attempts at loading a library from files and enter image description here

This next picture shows the chart2d source file and the problem with the package name. The files in the first library all begin with the same type of package declaration, but they work fine. enter image description here

EDIT: I tried compiling one of the .java files with javac Chart2d.java in the command line, but it can't find the other referenced files, such as Chart.java. Is there a way to compile the whole lot of them together?

0

There are 0 best solutions below