Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » MissingResourceException when using a source folder
MissingResourceException when using a source folder [message #202503] Thu, 26 February 2004 14:44 Go to next message
Eclipse UserFriend
Originally posted by: heather.hotmail.com

Hi,

I have been using resource bundles for a while to externalize strings in
my Java code. Recently I noticed a problem with using resource bundles
when I created a source folder in my Java Project and put my Java code
under that folder.

MyJavaProject
-- java (source folder)
-- x.y.z (Java package)
-- abc.java (the Java code that uses resource bundles)
-- etc
-- my_resource.properties

I have code like
"ResourceBundle res = ResourceBundle.getBundle("etc/my_resource");"
in "abc.java" and it throws a MissingResourceException at run time. I
checked what "new File(etc/my_resource.properties).exists()" returns, and
it returns true.

I don't have this problem when I don't use the source folder.

Could anybody tell me what I can do to solve this problem if I would like
to keep the source folder structure?

Thanks!

Heather
Re: MissingResourceException when using a source folder [message #202527 is a reply to message #202503] Thu, 26 February 2004 16:02 Go to previous message
Eclipse UserFriend
Originally posted by: heather.hotmail.com

Problem solved. Basically the path for "MyJavaProject" needs to be
included in the project's build path and it can be done through defining a
classpath variable ("Window" -> "Preferences" -> "Java" -> "Classpath
Variables") and define the path in the project's build path using the new
variable.

Thanks,

Heather

Heather wrote:

> Hi,

> I have been using resource bundles for a while to externalize strings in
> my Java code. Recently I noticed a problem with using resource bundles
> when I created a source folder in my Java Project and put my Java code
> under that folder.

> MyJavaProject
> -- java (source folder)
> -- x.y.z (Java package)
> -- abc.java (the Java code that uses resource bundles)
> -- etc
> -- my_resource.properties

> I have code like
> "ResourceBundle res = ResourceBundle.getBundle("etc/my_resource");"
> in "abc.java" and it throws a MissingResourceException at run time. I
> checked what "new File(etc/my_resource.properties).exists()" returns, and
> it returns true.

> I don't have this problem when I don't use the source folder.

> Could anybody tell me what I can do to solve this problem if I would like
> to keep the source folder structure?

> Thanks!

> Heather
Previous Topic:installing eclipse
Next Topic:Replacement Wizard and File!new menu
Goto Forum:
  


Current Time: Tue Jul 22 14:45:21 EDT 2025

Powered by FUDForum. Page generated in 0.10984 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top