• Post Reply Bookmark Topic Watch Topic
  • New Topic

err:can't find symbol while accessing a static method of a class from another class in same package  RSS feed

 
Ganish Patil
Ranch Hand
Posts: 529
19
Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Netbeans IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PrintSQLException compiles successfully.
But while compiling DisplayRecords.java gives error:can't find symbol pointing to PrintSQLExceptions.printSQLExceptions(e);on line 20.
Location of DisplayRecords: file: C:\Program Files\tooc\selfjava\database\Statement\mywork\ DisplayRecords.java and .class
Location of PrintSQLExceptions: file: C:\Program Files\tooc\selfjava\database\Statement\mywork\ PrintSQLExceptions.java and .class

This is the DisplayRecord class which access the static method printSQLExceptions of class PrintSQLExceptions in same package.



PrintSQLExceptions class
 
Tapas Chand
Ranch Hand
Posts: 614
9
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is compiling successfully at my end.
What command are you using to compile? post them.
I suppose you are compiling them from "mywork" directory.
you should compile them from the parent directory of "mywork" directory.
 
Dave Tolls
Ranch Foreman
Posts: 3068
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you compiling?
What command are you using, and where in your directory structure are you?

(ETA: OOoh, mere seconds! )
 
Ganish Patil
Ranch Hand
Posts: 529
19
Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Netbeans IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ops! can't believe this I was compiling it from mywork directory,Thank you so much Tapas and Dave
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!