• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java: Cannot find symbol

 
Jake Hammer
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have been struggling for some time with this. I have several .java files all in the same directory that I need to recompile for an upgrade project. One in particular is giving me some trouble...it is called Utils.java. This file accesses methods from another file called WebUserInfo. I have a file called WebUserInfo.java which I have successfully recompiled and I can see the .class file that was generated. When I try to compile Utils.java it throws several errors with regard to the methods contained in the WebUserInfo file...'cannot find symbol'. I have verified that the methods being called are indeed in the WebUserInfo file.

I've checked permissions and ownership on all the files and that is all in line. I am trying to run this on a linux system with the following command:


Can someone please help me out with this???

Thanks!!!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without knowing anything about your directory/package hierarchy and where you're compiling it from, no.
 
Campbell Ritchie
Sheriff
Posts: 48386
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also what the exact error messages are, please.
 
Jake Hammer
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Without knowing anything about your directory/package hierarchy and where you're compiling it from, no.


Does this matter if everything is in the same directory?
 
Jake Hammer
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Also what the exact error messages are, please.


Most of the messages say:

Utils.java:### cannot find symbol
symbol : class WebUserInfo
location : class path.to.Utils
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just post it? Seems easy enough.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And where you're compiling from.
 
Jake Hammer
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The current directory '.'
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Do you understand that if we don't know your directory hierarchy, your package structure, and where you're attempting to compile from, there is no way to help you? You have a simple classpath issue. You're either compiling from the wrong place, or your directory/package structure is wrong.

We gathered you were compiling from the currrent directory.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, please see the JavaRanch naming policy.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12085
29
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
xdfg sdf wrote:Does this matter if everything is in the same directory?

Folks are trying to help you. You should do everything you can to make it easy for them do do so if you want their help - such as answering the questions they ask to try and narrow down where the problem actually is.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64621
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"xdfg sdf", please check your private messages for an important administrative matter.
 
Henry Wong
author
Marshal
Pie
Posts: 20886
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:
xdfg sdf wrote:Does this matter if everything is in the same directory?

Folks are trying to help you. You should do everything you can to make it easy for them do do so if you want their help - such as answering the questions they ask to try and narrow down where the problem actually is.


I guess the answer to the original question is...

xdfg sdf wrote:
Can someone please help me out with this???


Without the correct and complete info... no.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic