• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

java: Cannot find symbol

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without knowing anything about your directory/package hierarchy and where you're compiling it from, no.
 
Marshal
Posts: 72686
317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also what the exact error messages are, please.
 
Jake Hammer
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not just post it? Seems easy enough.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And where you're compiling from.
 
Jake Hammer
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The current directory '.'
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, please see the JavaRanch naming policy.
 
lowercase baba
Posts: 12983
66
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67532
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"xdfg sdf", please check your private messages for an important administrative matter.
 
author
Posts: 23899
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic