简体   繁体   English

为ResourceBundle配置Eclipse

[英]Configuring Eclipse for ResourceBundle

I have a java program which uses ResourceBundle that runs fine when I run it from the command line. 我有一个使用ResourceBundle的Java程序,当我从命令行运行它时,它运行良好。 My properties files are all in a dedicated directory and this directory is in my PC's classpath. 我的属性文件都在一个专用目录中,并且此目录在我的PC的类路径中。

However, when I try to run the same program from Eclipse, I get an Exception: 但是,当我尝试从Eclipse运行同一程序时,出现异常:

Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name ResourceBundle 线程“主”中的异常java.util.MissingResourceException:找不到基础名称ResourceBundle的捆绑软件

How do I configure Eclipse so that it can find the properties files? 如何配置Eclipse,以便它可以找到属性文件?

If you have not re-started eclipse after adding it into PC's classpath then please do so. 如果您在将eclipse添加到PC的classpath中后还没有重新启动它,请这样做。 I hope you should see it after doing that. 希望您这样做后能看到它。

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

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