catch32
catch32

Reputation: 18612

Error - "java: cannot find symbol" in IntelliJ IDEA

I want to run my project but IntelliJ IDEA version 13 shows some strange error message:

enter image description here

Now class file has some small cross at class icon.

But this code was compiled, I couldn't figure out this strange behavior.

How to solve this trouble?

Upvotes: 6

Views: 13186

Answers (3)

Guosong
Guosong

Reputation: 81

Please try to rename the file name with suffix ".java" eventhough it is within the same package, if you insert this file as a java source file. Intellij is not intelligent in this aspect, it will not recognize it in the package without a suffix, and it is really stupid :-)

Upvotes: 8

Lukino
Lukino

Reputation: 1455

It is difficult to say without more details. Both classes, you project configuration, tools you are using, etc....

But definitely your class JDBCDAOFactory don't see your TeamDAO class.

What I will do: - check modifiers - visibility (should be ok while you have as it looks that you have both in same package)

  • try to use TeamDAO in other class (for instance DBUtil)

Upvotes: 0

Zyn
Zyn

Reputation: 614

I believe the class is excluded from compilation - I think I've had this before.

Try: Settings -> Compiler -> Excludes

Upvotes: 8

Related Questions