Accessing a config file from my Java application.

Discussion in 'Java' started by andoni.oconchubhair@fmr.com, May 17, 2007.

  1. Guest

    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.
    , May 17, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    3,009
    Juha Laiho
    Mar 13, 2005
  2. CSharpner
    Replies:
    0
    Views:
    1,000
    CSharpner
    Apr 9, 2007
  3. M Irfan
    Replies:
    2
    Views:
    3,901
    M Irfan
    Apr 18, 2007
  4. Nick Johnson

    Windows Application App.config Files vs. web.config

    Nick Johnson, Mar 12, 2007, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    652
    Nick Johnson
    Mar 12, 2007
  5. kampy
    Replies:
    9
    Views:
    318
    Steven D'Aprano
    Oct 19, 2012
Loading...

Share This Page