File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Need another set of eyes... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Need another set of eyes..." Watch "Need another set of eyes..." New topic

Need another set of eyes...

Joel McNary

Joined: Aug 20, 2001
Posts: 1824

This one has got me baffled, so I'm thinking that I need someone else's eyes to take a look and tell me where my mistake is.
I'm trying to run a program I wrote (on another machine) that reads a .properties file. However, when I go to run the program, I get the following error:

At first, I thought that it was because the program couldn't find the .properties file. But here's the directory listing, and as you can see, this is located in the Classpath specified by the -cp option to the JVM:

This prgram works fine on the machine that I wrote the program on, but I am unable to get it to run on another machine!
Here's the method causing the error:

Down the road this will move to Preferences anyway, but that doesn't help me now.
Any ideas what could be wrong?

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
I don't see a cause of the problem so far. But one thing you might try is changing the properties file name to
In theory you shouldn't need these; the system should try
eventually after finding that no more specific file exists. But try it; maybe you'll learn something useful. Good luck...
[ July 16, 2003: Message edited by: Jim Yingst ]

"I'm not back." - Bill Harding, Twister
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

This is interesting. On the development machine, I moved the code out of the development environment and into another environment and, lo and behold, it stopped working!
I then renamed the .properties file so that it was in the root package and the program found it no problem. So that's the solution I'm employing now, but...
This baffles me, though. Why would it work in the development environment but not in another environment? (I do use NetBeans for development, but I test everything through command-line or Textpad, which knows nothing about NetBean's settings.) And I've got a similar problem using Jasper reports, where the system can't seem to find the resources (specifically, subreports) even though they're located in the correct places...
BTW, Jim , The first thing I tried after posting was adding the _en_US, since I've had that problem before, too. That didn't work, though....
[ July 17, 2003: Message edited by: Joel McNary ]
I agree. Here's the link:
subject: Need another set of eyes...
It's not a secret anymore!