• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

cannot find symbol

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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




 
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 74709
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 479
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, forgot that root was the name of an actual unix directory. I should have used something like "project".

rc
 
Campbell Ritchie
Marshal
Posts: 74709
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And why are you setting a classpath at all?
reply
    Bookmark Topic Watch Topic
  • New Topic