线程“main”中的异常java.util.MissingResourceException:找不到基本名称的包

发布于 2025-01-13 08:27:58 字数 521 浏览 1 评论 0原文

非常感谢任何帮助...

package sampleA_code2;
...
public class CodeTwoSample {
...
ResourceBundle greetings = ResourceBundle.getBundle("sampleA_code2.GoodMannersBundle");

收到错误:

Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name sampleA_code2.GoodMannersBundle, locale en_IE

文件“GoodMannersBundle.properties”与“CodeTwoSample.java”位于同一文件夹中...

请问,有什么想法吗? 使用 Mac、NetBeans 12.6... 使用 Java 11、Java 8 进行测试...

谢谢!

Please any help is very appreciated...

package sampleA_code2;
...
public class CodeTwoSample {
...
ResourceBundle greetings = ResourceBundle.getBundle("sampleA_code2.GoodMannersBundle");

Get the error:

Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name sampleA_code2.GoodMannersBundle, locale en_IE

The file "GoodMannersBundle.properties" is in the same folder as "CodeTwoSample.java" is...

Please, any ideas?
Using Mac, NetBeans 12.6...
Tested with Java 11, Java 8....

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人生百味 2025-01-20 08:27:58

将属性文件移至
src/main/resources

也不再需要引用该包。
谢谢

Moved the properties files to
src/main/resources

Also no need to reference the package anymore.
Thanks

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文