简体   繁体   English

在Eclipse中进行调试时获取MissingResourceException

[英]Getting MissingResourceException when debugging in Eclipse

I imported a 3rd-party Java project into Eclipse that has the following block: 我将第3方Java项目导入到Eclipse中,该项目具有以下块:

configSrc = (PropertyResourceBundle) ResourceBundle.getBundle(fName);

When I debug this project under Eclipse, I get an MissingResourceException exception at this point. 当我在Eclipse下调试该项目时,此时会出现MissingResourceException异常。

When I run the JAR of the project from command-line (RedHat 6, if that makes any difference), it runs fine without any exceptions. 当我从命令行(RedHat 6,如果有区别)运行项目的JAR时,它运行正常,没有任何异常。 It's executed as follows: 它执行如下:

java -classpath /export/home/user/proj:/export/home/user/proj/lib/dist.jar my.foo.bar.topClass arg1 arg2 

where /export/home/user/proj is the root dir of that project and dist.jar is the JAR file. 其中/export/home/user/proj是该项目的根目录,而dist.jar是JAR文件。

I suspect that the reason for the exception is that I have to set CLASSPATH properly in Eclipse. 我怀疑异常的原因是我必须在Eclipse中正确设置CLASSPATH How would I do that? 我该怎么做?

右键单击要运行的类,选择调试为,选择调试配置,随即打开面板,其中包含所有用于调试,设置类路径或参数的选项。

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

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