public xFbConfigReader()
{
//props = new Properties();
propsdatabase = new Properties();
try
{
// load a properties file
InputStream dbin = getClass().getResourceAsStream("/properties/database.properties");
propsdatabase.load(dbin);
}
catch (IOException ex)
{
ex.printStackTrace();
}
}
I keep My properties File named ‘Database.properties’ in a folder where the project is named ‘Properties’.
When I do a Export as jar in Eclipse . The Properties Folder is visible.

But When I run the program it shows that there is a NUll point exception in dbin.
So which means I require the proper way to form a jar in Eclipse .Kindly suggest.
The better solution while handling properties file would be reading
This is better approch because
a folder called Configuration where you can include all the
properties files. As it is out side of jar you can change the
properties file when ever is required.
file no need to unjar it.
(OR) simply you can make this change no need to think about directory structure
step 2: change this line as
follows
InputStream dbin = getClass().getResourceAsStream(“/database.properties”);
This is not much different from previous code as it is anyway stays inside the JAR file.