• Post Reply Bookmark Topic Watch Topic
  • New Topic

javac cannot find symbol  RSS feed

 
albert kao
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following two files are in the same directory.
Eclipse is the IDE.
Please help to fix the javac cannot find symbol buildUserInfos error.





[javac] C:\Users\tm\Workspace\myproj\implementation\src\InfoDelegate.java:147: cannot find symbol
[javac] symbol : method buildUserInfos(my.proj.WebUserInfo[])
[javac] location: class my.proj.InfoDelegate
[javac] UserInfo[] UserInfos = buildUserInfos(webUserInfos);
[javac] ^

 
Paweł Baczyński
Bartender
Posts: 2086
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't try to run javadoc on your code so I'm just guessing.
You said those two files are in the same directory.
I noticed they are in different packages. Maybe this is the problem?

From your output I can see that your source file is:
C:\Users\tm\Workspace\myproj\implementation\src\InfoDelegate.java

InfoDelegate class is in my.proj package.
So the path should be:
C:\Users\tm\Workspace\myproj\implementation\src\my\proj\InfoDelegate.java

One of your classes is in my.proj package and the other is in com.my.proj. Is this what your want? Or is it a mistake?
 
albert kao
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fix the package and path problem, but still has the same "javac cannot find symbol" problem.
Please help.
Thanks.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The issue isn't with the class, it's with one of its methods, specifically "my.proj.InfoDelegate.buildUserInfos(my.proj.WebUserInfo[])". Does a method with that signature exist?
 
albert kao
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem is solved by
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!