开发者

unable to compile simple java applet

I am trying to compile a simple java applet from the examples of JUNG. I was desperate enough to try adding everything in the classpath.

$ javac -cp collections-generic-4.01.jar -cp colt-1.2.0.jar 
  -cp concurrent-1.3.4.jar -cp j3d-core-1.3.1.jar -cp jung-3d-2.0.1-sources.jar 
  -cp jung-3d-2.0.1.jar -cp jung-3d-demos-2.0.1-sources.jar -cp jung-3d-demos-2.0.1.jar 
  -cp jung-algorithms-2.0.1-sources.jar -cp jung-algorithms-2.0.1.jar 
  -cp jung-api-2.0.1-sources.jar -cp jung-api-2.0.1.jar 
  -cp jung-graph-impl-2.0.1-sources.jar -cp jung-graph-impl-2.0.1.jar 
  -cp jung-io-2.0.1-sources.jar -cp jung-io-2.0.1.jar -cp jung-jai-2.0.1-sources.jar 
  -cp jung-jai-2.0.1.jar -cp jung-jai-samples-2.0.1-sources.jar 
  -cp jung-jai-samples-2.0.1.jar -cp jung-samples-2.0.1-sources.jar 
  -cp jung-samples-2.0.1.jar -cp jung-visualization-2.0.1-sources.jar 
  -cp jung-visualization-2.0.1.jar -cp stax-api-1.0.1.jar -cp vecmath-1.3.1.jar 
  -cp wstx-asl-3.2.6.jar 

But the result is always the same.

edu/uci/ics/jung/samples/AddNodeDemo.java 
edu/uci/ics/jung/samples/AddNodeDemo.java:13: package edu.uci.ics.jung.algorithms.layout does not exist
import edu.uci.ics.jung.algorithms.layout.AbstractLayout;
                                         ^
edu/uci/ics/jung/samples/AddNodeDemo.java:14: package edu.uci.ics.jung.algorithms.layout does not exist
import edu.uci.ics.jung.algorithms.layout.FRLayout;
                                         ^

And much more...

开发者_StackOverflow

Please note that I know nothing about java.


You cannot do multiple -cp switches like that. Combine them like java -cp one:two:three on Linux/OSX and java -cp one;two;three on Windows.

If you are actually interested in learning java, check out compiling with Ant.


It seems you're missing another library. To be more precise you're missing the library (.jar file) that contains the AbstractLayout and FRLayout classes in the edu.uci.ics.jung.algorithms.layout package.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜