简体   繁体   English

我有一个无法在 Eclipse 上删除的默认 package?

[英]I have a default package that I can't delete on Eclipse?

I'm not exactly sure how I did this, but I can't remove it.我不确定我是怎么做到的,但我无法删除它。

See below screenshot, I now have a (default package) that is causing me errors.请参见下面的屏幕截图,我现在有一个(默认包)导致我出错。

(默认包)的屏幕截图

I've gone to the file location and it doesn't exist, if I right click to delete, the delete option is greyed out.我去了文件位置,它不存在,如果我右键单击删除,删除选项是灰色的。 I've tried closing and reopening the project as well as refreshing the project and neither work.我试过关闭并重新打开项目以及刷新项目,但都没有工作。

SRC 文件夹的文件位置

Can anyone give me any advice on how to remove this package?谁能给我任何关于如何删除这个 package 的建议?

Thank you!谢谢!

I've discovered that's it's because I changed my JRE to 1.8.我发现那是因为我将 JRE 更改为 1.8。 Upon moving back to JavaSE-16, I have fixed it/the package disappeared.回到 JavaSE-16 后,我已修复它/package 消失了。 Thanks for anyone who took the time to read anyway!感谢任何花时间阅读的人!

Move your java file from the default package to any other package and then refresh the project issue will be resolved.将 java 文件从默认的 package 移动到任何其他 package,然后刷新项目问题将得到解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM