Cannot find symbol class error

Answered

Hello,

 

I was a Eclipse user, and now I am trying to setting my project in IntelliJ to become an IntelliJ user.

However I got error like :

'Cannot find symbol class' error.

Situation is like this.

 

A.java

-----------

B {

}

A extends C {

}

-----------

 

Two different classes are exist at one java file.

And In upper case, error message like ' cannot find symbol C class'.

Even though I have C class file in the same package.

 

At eclipse, there is no compile error like that, but IntelliJ does.

So I think there is some missing setting, or more strict inspection at IntelliJ perhaps?

Any Idea what brings that error?

 

Please help me. Thanks

Regards MJ 

0
8 comments

could you please provide a demo project?

0

Demo project?

I don't know what you refer..

Sorry please be specific about demo project

0

An example project to reproduce a problem.

0

Hum.. 

B {

}

A extends C {

}

 

I can't assume that how specific example you need..

Whole file could be help? (the problem java source?) 

0

B {

}

A extends C {

}

Is not enough to reproduce a problem, I have tried creating a simple runnable project:

A.java 

------------

class B {

}

class A extends C {

}




C.java
--------------

class C
{
static void test(){
System.out.println("test");
}
}




Main.java

---------------

public class Main
{
public static void main(String[] args)
{
A.test();
}
}


 

Still, the problem has not reproduced. Please provide the entire project archived.

 

0

Oh I see, I got your point now.

Actually our project is kind of big scale, and I don't think I can't upload whole files. 

So I will re-create demo project which have my same problem!

Will takes some times..

 

Thanks

0

My intellij is showing "cannot find symbol class scanner"

0

97 Shivapatil

Have you added an import statement for the Scanner class? (see example below)

import java.util.Scanner;

 

0

Please sign in to leave a comment.