aspose file tools*
The moose likes Beginning Java and the fly likes cannot find symbol Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "cannot find symbol" Watch "cannot find symbol" New topic
Author

cannot find symbol

albert kao
Ranch Hand

Joined: Feb 04, 2010
Posts: 245
Please help to solve the "cannot find symbol" error on linux:
$ export CLASSPATH=.

$ javac Vertex.java
$ javac DFS.java
DFS.java:6: cannot find symbol
symbol : class Vertex
location: class graph.DFS
public Vertex[] vertex;
^
DFS.java:9: cannot find symbol
symbol : class Vertex
location: class graph.DFS
public PriorityQueue<Vertex> queue = new PriorityQueue<Vertex>();
^
DFS.java:30: cannot find symbol

...


Vertex.java


DFS.java




Ralph Cook
Ranch Hand

Joined: May 29, 2005
Posts: 479
if Vertex and DFS are classes in the graph package, then they both have to be in a (sub) directory named "graph", and should be compiled from the directory that contains graph.

$ cd /root
$ ls
graph
$ javac graph/Vertex.java
$ javac graph/DFS.java

My unix is quite rusty, but I hope that's enough to give you the idea. Could that be your problem?

rc
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38767
    
  23
I would have thought you start with something like cd java. If you go to /root, you won't usually have write permission.
Ralph Cook
Ranch Hand

Joined: May 29, 2005
Posts: 479
Sorry, forgot that root was the name of an actual unix directory. I should have used something like "project".

rc
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38767
    
  23
And why are you setting a classpath at all?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cannot find symbol