Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

resource bundle error

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All, I hope this is the right forum to post this message.

I am trying to use the ResourceBundle class to get a properties file

my code looks like this



its command line invocation.

The properties file is in the same directory as this file.

I am using Eclipse IDE.

It is giving me this error



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



example_export is the properties file.

Please let me know what I am missing.

Thanks
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eclipse is probably putting your class file in a different directory. For this to work the resource bundle needs to be in the same directory as the class, not the source (.java) file. I would try running it from the command prompt. Do a dir (I'm assuming you're using Windows) in the directory to verify that the class and the resource bundle are both present.
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic