• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Reading Properties files in NetBeans

Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I'm facing problem while reading properties file with java program in NETBEANS IDE.The same Program is working fine in ECLIPSE IDE.How can i run this program correctly in NetBeans please help me out.The Program is give below (all files are in "propdemo" package)
package propdemo;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class MyProp {

private static Properties prop =null;
public static Properties loadProperties(){
InputStream in=null;
ClassLoader cl=ClassLoader.getSystemClassLoader();
prop = new Properties();
}catch(IOException ioe){
return prop;


package propdemo;

import java.util.Properties;

public class RunMe {
* @param args
public static void main(String[] args) {

Properties pr = MyProp.loadProperties();


& prop.properties files content

prop1=This is property 1
prop2=This is property 2
prop3=This is property 3
prop4=This is property 4
prop5=This is property 5

Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's working fine on my NetBeans. Can you give more details (any exceptions thrown, etc)?
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic