最佳答案
解决此问题的一个简单方法是删除 Project Explorer 选项卡上的 module-info.java 文件。 Eclipse 默认创建它,并且删除它不会影响程序的任何功能。所以,去吧...
关于java - 错误 : Must declare a named package because this compilation unit is associated to the named module '*******' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51803456/