Relative Paths in Java Program
807588Apr 1 2009 — edited Apr 1 2009Hi All,
In one of the java programs i am trying to read a properties file using the Properties class
Please find the code below
private static final String magicPropFile = "config.prop";
Initial.magicProps = new Properties();
Initial.magicProps.load(new FileInputStream(Initial.magicPropFile));
This throws a FileNotFoundException
I have placed the file in the same directory as the .java files. I am using Eclipse IDE. The files are placed in a package com.xyz.sample
All the .java and the prop files are in the same directory
It works fine when i give the absolute path from my Desktop.
Can anyone tell me that is the file placed properly or any change in the code that needs to be done?
Rgds
Aditya