Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8287617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:05:55+00:00 2026-06-08T12:05:55+00:00

About the resourcebundle errors, I’ve read other questions about the same subject, but I

  • 0

About the resourcebundle errors, I’ve read other questions about the same subject, but I didn’t get any wiser. Tried different things, doesn’t help. To give a little background: I developed a small app (JDK6), that does some flat file parsing and editing automatically. The app starts by reading some data from a properties file.

Important:
I want to be able to change the properties file. I don’t want to put it in the jar file.

However, even with the little example app that I tried creating, based on another questions/answer [here][1]:

package restestapp;

import java.util.Locale;
import java.util.ResourceBundle;


public class ResourceBundleTester
{
    public static void main(String[] args)
    {
        Locale locale = Locale.getDefault();
        String basename ="myresource";
        ResourceBundle resourceBundle = ResourceBundle.getBundle(basename, locale);
        System.out.println(resourceBundle.getString("STARTING_MYAPP"));
    }
}

Both files are here:

/home/dakoina/Documents/ResTestapp/ResTestApp.jar
/home/dakoina/Documents/ResTestapp/myresource.properties

or even

c:/temp/ResTestApp.jar
c:/temp/myresource.properties

But when I run it, it gives me this output:

dakoina@ubuntu:~/Documents/ResTestapp$ java -cp /home/dakoina/Documents/ResTestapp/ -jar "ResTestApp.jar"
Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name myresource, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1539)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1278)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:805)
    at restestapp.ResTestApp.main(ResTestApp.java:19)

and in Windows, the same…

c:\temp>java -jar ResTestApp.jar
Exception in thread "main" java.util.MissingResourceException: Can't find bundle
 for base name myresource, locale en_US
        at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
        at java.util.ResourceBundle.getBundleImpl(Unknown Source)
        at java.util.ResourceBundle.getBundle(Unknown Source)
        at restestapp.ResTestApp.main(ResTestApp.java:19)
  [1]: http://stackoverflow.com/questions/3742158/using-resourcebundle-with-an-external-file-java

I can’t see where I am wrong :/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:05:56+00:00Added an answer on June 8, 2026 at 12:05 pm

    -jar means: compose the classpath from the given jar and from all the ones it references in its manifest. So the -cp option is ignored.

    Your command line should be:

    java -cp /home/dakoina/Documents/ResTestapp;/home/dakoina/Documents/ResTestapp/ResTestApp.jar the.main.Class
    

    That said, a resource bundle is used to load internationalized labels. If you just want to read properties, you’d bette use the java.util.Properties class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read about properties and resource bundle. But I was unable to get difference
I have been reading other questions and answers around this but I am not
About what I read, the EditorTemplates folder must be located under the Shared folder
About 5 times over the past 6 months, in complex javascripts, I'll get an
I know that there are a lot of questions and answers exactly about this
About a month ago Mitt’s question went unanswered. Sadly, I’m running into the same
About to start working on a social networking site, but I'd like to incorporate
Recently I've decided to get some knowledge about writing custom tags. And there is
About So this question has been asked time and time again, but I noticed
about answers below, thanks a lot but it doesn't work, may be problem also

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.