Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How come my eclipse editor shows no error but when I try to run the file, it shows "cannot be resolved to a type" error?

Tags:

java

eclipse

as stated in the title.

like image 488
tanyehzheng Avatar asked Dec 30 '25 19:12

tanyehzheng


2 Answers

In Eclipse, try "Project" > "Clean..." (if "Project" > "Build Automatically" is checked)

This should force Eclipse to rebuild your app and it should catch the error.

like image 74
markvgti Avatar answered Jan 01 '26 09:01

markvgti


The Eclipse incremental compiler sometimes gets 'confused' so try a 'Project -> Clean... -> Clean All Projects'. This will do a complete rebuild of your workspace. After that all weird compiler problems disappear.

But in general it would be better to have more information about your problem (as stated by the others)

like image 33
GandalfIX Avatar answered Jan 01 '26 09:01

GandalfIX



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!