title: tell java program where is properties file
body: <p>I have done java program that I'm trying to install to linux machine. Unfortunately my program doesn't sees property file and gets default values. What is the way of telling java where is property file placed?</p>
  
  <pre><code>Program is placed in:
  /opt/myProg
  
  Properties are placed in:
  /opt/myProg/config.ini
  
  
  external jar:
  /opt/myProg/lib
  
  classes in packeges:
  /opt/myProg/Prog
  
  
  Command I'm trying to run my program:
  java -cp /opt/myProg/lib/log4j.jar:/opt/myProg/Prog:/opt/myProg/. startpkg.runme
  </code></pre>
  
  <p>This command also does't helps:</p>
  
  <pre><code>java -cp /opt/myProg/lib/log4j.jar:/opt/myProg/Prog:/opt/myProg/. startpkg.runme -Dconfig.ini=/opt/myProg/config.ini 
  </code></pre>
  
  <p>code that is trying to load props looks like:</p>
  
  <pre><code>p.load(new FileInputStream("config.ini"));
  </code></pre>