Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Must declare a named package because this compilation unit is associated to the named module '*******'

I was trying to open a program I made before but for some reason the following error always appeared: Must declare a named package because this compilation unit is associated to the named module '********'

enter image description here

like image 252
chawks312 Avatar asked Sep 05 '25 03:09

chawks312


1 Answers

An easy solution to this problem is to delete the module-info.java file present on your Project Explorer tab. Eclipse created this by default, and also, removing this will not affect any functionality of your program. So, go for it...

like image 192
Mudit Chauhan Avatar answered Sep 07 '25 22:09

Mudit Chauhan