Accessing a config file from my Java application.

  • Thread starter andoni.oconchubhair
  • Start date
A

andoni.oconchubhair

Hello,

I have written a Java program which does some calculations and prints
the results to Standard Out/System Out. It is packaged inside a .jar
file. I call this program from a .sh file so that I can set up the
CLASSPATH and some parameters. Then I put an 'alias' entry in /etc/
profile so that I can use one command to run the program from any user
without them knowing the path.

This all worked fine until I went to make my program configurable. I
added a 'config.properties' file with some data. The program will now
only work if set the ownership of config.properties to my user:group
(an then only work for me) or if I put the full path to
config.properties into the Java code.

Can anyone please tell me why the relative path won't work if anyone
but the owner of the file is using the program? I have given full
permissions to all these files and still no joy.

Thanks for any suggestions.

Andoni.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top